Hey there folks,
I have a php/mysql site that is working pretty good. I can add/update/delete and display data pretty much at will. Which makes my problem that much more of a mystery to me! Maybe one of you kind folks here can spot my error.
Ok. simple insert into a database. Why does this line work:
$query=“INSERT INTO $table (Division, Handler, Dog, event, Club, order) VALUES (’$Division’, ‘$Handler’, ‘$Dog’, ‘$Event’, ‘$Club’, ‘$order’)”;
and yet, this line doesn’t!:
$query=“INSERT INTO $table (Division, Handler, Dog, event, Club) VALUES (’$Division’, ‘$Handler’, ‘$Dog’, ‘$Event’, ‘$Club’)”;
As you see, the only difference is one field, and the corresponding data!
The answer to your first question is yes, the field does exist. The ‘order’ field is type “int(4)”. So is the ‘event’ field, and no problems there.
Here’s the error:
"“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘order) VALUES (‘division1’, ‘John Smith’, ‘Spot’, ‘137’, ‘ClubA’, ‘299’)’ at line 1”
??? I am mystified.