Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7614817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:29:59+00:00 2026-05-31T02:29:59+00:00

THE MISSING _ WAS A TYPO ON STACKOVERFLOW, I WAS TESTING. I’m trying to

  • 0

THE MISSING _ WAS A TYPO ON STACKOVERFLOW, I WAS TESTING.

I’m trying to insert a value to my database using the following two files:

Add Record:

 <form action="AddVenue.php" method="post" />
<p>Venue Name: <input type="text" name="venue_name" /></p>
<p>Venue Capacity: <input type="text" name="venue_capacity" /></p>
<input type="submit" value="Submit" />
</form>

AddVenue.php

<?php
require("dbconnection.php"); // Connect to Database

// Select Database

$db= 'database';  
mysql_select_db($db) or die("Could not select database");


$venue_name = $_POST['venue_name'];
$venue_capacity = $_POST['venue_capacity'];

$sql = "INSERT INTO Venues (venue_name) VALUES ('$venue_name')";
$sql = "INSERT INTO Venues (venue_capacity) VALUES ('$venue_capacity')";

if (!mysql_query($sql))
{
       die('Error: ' . mysql_error());
}



mysql_close();
?>

At the moment, it adds the to the field venue_capacity without fault, however it always adds NULL to the venue_name field. The capacity field is an INT, and the name field is VARCHAR.

I have no idea why it’s doing it, they are the same a pat from the names, which I have double and triple checked. Does anyone have any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:30:00+00:00Added an answer on May 31, 2026 at 2:30 am

    You are resetting $sql with a new query without performing it first.

    You should combine the two queries into one:

    INSERT INTO Venues (venue_name, venue_capacity) VALUES ('$venue_name', '$venue_capacity');
    

    Your form also needs to have the field named venue_name instead of venuename.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to post data with AJAX and insert it into a database table.
... where missing records are identical to the last recorded value, hence no record.
Looking at the missing index DMVs on SQLServer it suggests I add the following
I'm probably missing something obvious here but here's what I'm trying to do. From
Hi i am missing the color code of my web.config files in Visual studio
I'm learning perl's *nix system tools and I've been staring at the following two
I am getting a Missing artifact org.springframework.security:spring-security-parent:jar:3.0.7.RELEASE:compile error in the pom.xml when I add
I'm trying to find comment blocks in PHP source code using regular expressions in
I have found the following page on the matter: http://typo3.org/development/articles/using-cache-control-headers-in-typo3/page/3/ But enabling config.sendCacheHeaders does
Probably missing something completely obvious here, but here goes. I'm starting out with Spring

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.