05-30-2005, 06:37 PM
|
#1 (permalink)
|
|
The Wanderer
Join Date: May 2005
Location: Maine|USA
Posts: 17
Thanks: 0
|
Submission form issues
I have created a MySQL DB, stuff, it contains two a table named xbox. There are multiple fields that contain Title, publisher, purchased, etc.
I can successfully insert the title into the DB, but when I try to submit multiple input fields (from the web form) it only adds the publisher, not the title.
Here's the code:
PHP Code:
// If info has been submitted add it to the DB. if (isset($_POST['title'])) { $title = $_POST['title']; $sql = "INSERT INTO xbox SET title='$title'"; } if (isset($_POST['publisher'])) { $publisher = $_POST['publisher']; $sql = "INSERT INTO xbox SET publisher='$publisher'"; if (@mysql_query($sql)) { echo '<p>Your info has been added.</p>'; } else { echo '<p>Error adding submitted info: ' . mysql_error(). '</p>'; } }
|
|
|