Mysql超奇怪的语法错误?
INSERT INTO pmessage (content, time, sent_by, to) VALUES ('k', '0000-00-00 00:00:00', 84, 1);
您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在第 1 行 'to) VALUES('tt', '2011-04-28 14:04:45', 84, 1)' 附近使用的正确语法
问题是我看不出我的语法有什么问题。列名等没有问题,我们试了很多次。我们从互联网上复制/粘贴了精确的插入命令几次,但仍然遇到相同的错误。
有人有什么想法吗?服务器是MySQL 5服务器
INSERT INTO pmessage (content, time, sent_by, to) VALUES ('k', '0000-00-00 00:00:00', 84, 1);
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 'to) VALUES('tt', '2011-04-28 14:04:45', 84, 1)' at line 1
The problem is i cannot see anything wrong with my syntax. There is nothing wrong with the column names etc, we tried many times. We copy/pasted the exact insert command from internet a few times than edited and still we got same error.
Anyone have any idea? The server is a MySQL 5 server
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
TO
是保留字。请参阅此处: http://dev.mysql.com/doc/ refman/5.0/en/reserved-words.html。试试这个:
TO
is a reserved word. See here: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html.Try this instead:
to
是 MySQL 关键字。你不能就这样免费使用它。尝试[到]
to
is a MySQL keyword. You cannot just use it free like that. Try[to]
你的问题是
to
是 MySQL保留字,因此您需要引用它。You problem is that
to
is a MySQL reserved word, so you'll need to quote it.to
是保留词:http: //dev.mysql.com/doc/refman/5.1/en/reserved-words.htmlto
is a reserver word: http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html将“to”用反引号括起来
Wrap "to" in backticks