mrwilson
01-01-2007, 08:33 AM
I have a very simple (read 1st) database to keep track of books
Using PhpMyAdmin, I have copied the connect (no problem here) script and the insert script. I am using a form to insert the data so obviously had to rewite the insert part. The problem is, that the database will not pick up the $post from the 1st field and insert the data into the database. is there something I am missing in the following scripts?
MySQL
$sql = ("INSERT INTO `books`(`Book`, `Year`, `Author`, `Number`, `Series`, `Recommendation`, `Status`, `Key`)
VALUES ('$_Post[Book]', '$_POST[Year]', '$_POST[Author]', '$_POST[Number]', '$_POST[Series]', '$_POST[Recomendation]', '$_POST[Status]', NULL)");
There are 3 text fields in the Db, and all three are configured the same. The first text field BOOK is the one that does not accept data. It does work fine when entered from PhpMyAdmin.
The form for the first field is a normal form:
Book Name: <input name="Book" type="text" tabindex="1" maxlength="200" size="50"
All other fields inthe db accept the form data properly.
I get no error messages, plus use a small php script to tell me what data I entered on the post page. That shows the data was entered properly.
Any thoughts or further code required?
Using PhpMyAdmin, I have copied the connect (no problem here) script and the insert script. I am using a form to insert the data so obviously had to rewite the insert part. The problem is, that the database will not pick up the $post from the 1st field and insert the data into the database. is there something I am missing in the following scripts?
MySQL
$sql = ("INSERT INTO `books`(`Book`, `Year`, `Author`, `Number`, `Series`, `Recommendation`, `Status`, `Key`)
VALUES ('$_Post[Book]', '$_POST[Year]', '$_POST[Author]', '$_POST[Number]', '$_POST[Series]', '$_POST[Recomendation]', '$_POST[Status]', NULL)");
There are 3 text fields in the Db, and all three are configured the same. The first text field BOOK is the one that does not accept data. It does work fine when entered from PhpMyAdmin.
The form for the first field is a normal form:
Book Name: <input name="Book" type="text" tabindex="1" maxlength="200" size="50"
All other fields inthe db accept the form data properly.
I get no error messages, plus use a small php script to tell me what data I entered on the post page. That shows the data was entered properly.
Any thoughts or further code required?