开发者

problem in php mysql_query()

开发者 https://www.devze.com 2022-12-17 04:51 出处:网络
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

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

精彩评论

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

关注公众号