Brett Lathrope - 2003-03-05

phpCodeGenie builds the following query string from the form it generated ....

$query="insert into sports (desc,name,level,gender,onseason) VALUES ('$descField','$nameField','$levelField','$genderField','$onseasonField')";

The problem is, nothing was getting inserted into the database.  But since there was no die(), it told me everything was ok.

So I added the die, and now I have this;

$result = MYSQL_QUERY($query) or die("Invalid query: " . mysql_error());

And that produces this....

Invalid query: You have an error in your SQL syntax near 'desc,name,level,gender,onseason) VALUES ('Girls Baseball','Baseball','Varsity','' at line 1

What the heck?  I see nothing wrong.  Yet I can go in with phpMyAdmin and add records all day long.

Help!!!!  :)

Brett