I try to run the following query.
INSERT INTO sections (order,edit,remove,section,type)
VALUES('blah','blah','blah','blah','blah');
In response I got the the message:
ERROR 1064 (42000): 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,edit,remove,section,type) VALUES('blah','blah','blah','blah','blah')' at line 1.
Any idea to fix
ERROR 1064 (42000): You have an error in your SQL syntax;?
Your above query contains reserved words in it those are causing error 1064 (42000). ORDER is a reserved word in MySQL and in standard SQL as well. If the column name in the table is ORDER, then put backquotes (
`) around the word ORDER when using it as a column name. For Example:
INSERT INTO sections (`order`,edit,remove,section,type)
VALUES('blah','blah','blah','blah','blah');
Best practice: Don't use reserved words for object (table, column,) or to use backquotes beside every column you used like:
INSERT INTO sections (`order`,`edit`,`remove`,`section`,`type`)
VALUES('blah','blah','blah','blah','blah');