开发者

problem in php mysql_query()

I have the following table:

table name: down
fields: id, key
and value in it is...
1, 1233

where id has INT 11 primary key and key is var开发者_如何学Cchar

and my query is

SELECT * FROM down WHERE key='1233'

but it is not working please let me know what is actually the problem...

and giving me the following 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 'key='5SD66R104'' at line


key is a reserved word in MySQL. If you reall want to use it (which I advise against) you have to quote it with ` like so:

SELECT * FROM down WHERE `key` = '123'


Put `` ` sign on table name and column name, like this:
SELECT * FROM down WHERE key='1233'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜