Reply to Re: MySQL INSERT problem

Your name:

Reply:


Posted by Nicholas Sherlock on 06/18/05 04:23

Malcolm Dew-Jones wrote:
> Caversham (acaversh@yahoo.com) wrote:
> : I am trying to insert data into the fields id and term of the table
> : key. id is an auto-incrementing field.
>
> : Each of the following forms fails:-
>
> : 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?
>
> Guessing, but is key a keyword? You might need to use a different name
> for the table.

If this is so, he should be able to use backticks ' ` ' to do the job:

INSERT INTO `key` (id, term) VALUES (0, 'dog')

Cheers,
Nicholas Sherlock

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация