首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >MySql访问冲突或语法错误

MySql访问冲突或语法错误
EN

Stack Overflow用户
提问于 2012-08-10 02:10:35
回答 1查看 1.2K关注 0票数 3

当我尝试执行下面的sql语句时,我得到了以下错误。

代码语言:javascript
复制
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'like, agree, favor, discriminator) VALUES ('5023fb89189df', 0, '2012-08-09 14:03' at line 1

完整的sql语句如下

代码语言:javascript
复制
INSERT INTO activity (id, hide_author, created, updated, access, location, disabled, created_ip, updated_ip, params, body, audit, hide_activity, author, owning_activity, like, agree, favor, discriminator) VALUES ('5023fa5a63d1b', NULL, '2012-08-09 13:58:50', '2012-08-09 13:58:50', NULL, NULL, 0, '192.168.1.1', NULL, NULL, 'Exactly, I would prefer to be able to defend myself when the unthinkable happens', NULL, 0, '50143c83e3f5a', '5023e63dafe18', 1, NULL, NULL, 'commentpost')

我没有看到任何语法错误,但也许你们可以给出一些建议,说明什么类型的访问冲突可能是原因。我应该找什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-08-10 02:15:05

"Like“是SQL中的保留字。将其括在反引号中。这是计算机上"1“旁边的键,如下所示:

代码语言:javascript
复制
INSERT INTO activity (id, hide_author, created, updated, access, location, disabled, created_ip, updated_ip, params, body, audit, hide_activity, author, owning_activity, `like`, agree, favor, discriminator) VALUES ('5023fa5a63d1b', NULL, '2012-08-09 13:58:50', '2012-08-09 13:58:50', NULL, NULL, 0, '192.168.1.1', NULL, NULL, 'Exactly, I would prefer to be able to defend myself when the unthinkable happens', NULL, 0, '50143c83e3f5a', '5023e63dafe18', 1, NULL, NULL, 'commentpost')
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11889448

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档