![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
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,correct_answer,score,delay) VALUES ('geoff','A001X001','C1',1,'1','6','4',' at line 1 |
#2
| |||
| |||
|
|
geoff (AT) invalid (DOT) invalid wrote: 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,correct_answer,score,delay) VALUES ('geoff','A001X001','C1',1,'1','6','4',' at line 1 Maybe "order" is a restricted keyword. My practice is to never use real English words as fieldnames or variables. Try restructuring to use, say, "order_1" instead and see what happens. You might also wrap order in `` -- `order` -- but it is still a keyword, which might give problems elsewhere. Ah yes. "order" is listed here as a reserved keyword: http://dev.mysql.com/doc/refman/5.0/...ved-words.html |
#3
| |||
| |||
|
|
"Beauregard T. Shagnasty" wrote: geoff (AT) invalid (DOT) invalid wrote: 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,correct_answer,score,delay) VALUES ('geoff','A001X001','C1',1,'1','6','4',' at line 1 Maybe "order" is a restricted keyword. My practice is to never use real English words as fieldnames or variables. Try restructuring to use, say, "order_1" instead and see what happens. You might also wrap order in `` -- `order` -- but it is still a keyword, which might give problems elsewhere. Ah yes. "order" is listed here as a reserved keyword: http://dev.mysql.com/doc/refman/5.0/...ved-words.html Bang on Beauregard !! Changed to a_order and all is well again. Previously it was something like c1_order so the problem didn't arise. |
|
Was it experience that told you that "order" might be the problem being a restricted [reserved] word? The error message doesn't give much of a clue, does it? |
#4
| |||
| |||
|
|
geoff (AT) invalid (DOT) invalid wrote: "Beauregard T. Shagnasty" wrote: geoff (AT) invalid (DOT) invalid wrote: 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,correct_answer,score,delay) VALUES ('geoff','A001X001','C1',1,'1','6','4',' at line 1 Maybe "order" is a restricted keyword. My practice is to never use real English words as fieldnames or variables. Try restructuring to use, say, "order_1" instead and see what happens. You might also wrap order in `` -- `order` -- but it is still a keyword, which might give problems elsewhere. Ah yes. "order" is listed here as a reserved keyword: http://dev.mysql.com/doc/refman/5.0/...ved-words.html Bang on Beauregard !! Changed to a_order and all is well again. Previously it was something like c1_order so the problem didn't arise. What caused you to change it from c1_order to order? |
|
Was it experience that told you that "order" might be the problem being a restricted [reserved] word? The error message doesn't give much of a clue, does it? Yes, experience. As I said, I don't use English words for fieldnames and variables because I was bitten by the same problem (once) eons ago. That's why I stopped using any form of a real word. Frequently, I prepend a letter indicating the type of data: corder .. cfirstname .. ddob .. ipkey .. bsubscribed .. where c=character, d=date, i=integer, b=boolean etc. "check the manual ... for the right syntax to use near 'order, " was an instant clue to me. :-) |
|
Note too that PHP also has its own list of reserved words. http://www.php.net/manual/en/reserved.keywords.php |
![]() |
| Thread Tools | |
| Display Modes | |
| |