0

我正在编写一些 PHP 代码来将一个值插入到我的 MySQL 数据库中:

INSERT INTO users_validate (uid, key) VALUES ('11', '4866ce5568850eb5f8daad79a8822d26')

谁能告诉我这有什么问题?

编辑:错误消息是

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) VALUES ('11', '4866ce5568850eb5f8daad79a8822d26')' at line 1
4

1 回答 1

5

尝试转义您的列名key

INSERT INTO users_validate (uid, `key`) VALUES ('11', '4866ce5568850eb5f8daad79a8822d26')

KEY是 MySQL 中的保留字:http: //dev.mysql.com/doc/refman/5.0/en/reserved-words.html

于 2012-08-26T12:58:14.487 回答