|
Posted by Tom Thackrey on 06/18/05 05:49
On 17-Jun-2005, "Caversham" <acaversh@yahoo.com> wrote:
> INSERT INTO key (id, term) VALUES (0, 'dog')
>
> INSERT INTO key ('id', 'term') VALUES (0, 'dog')
>
> INSERT INTO 'key' ('id', 'term') VALUES (0, 'dog')
>
> INSERT INTO 'key' (id, term) VALUES (0, 'dog')
>
> mysql_error() returns messages of the following form:-
>
> 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 'key (id,
> term) VALUES (0, 'dog')' at line 1
>
> What is wrong with the syntax?
"key" is a mysql keyword and needs to be enclosed in backticks: `key`
http://dev.mysql.com/doc/mysql/en/reserved-words.html
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
Navigation:
[Reply to this message]
|