You have an error in your SQL syntax; check the manual that corresponds to your MySQL

Posted svygh123

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了You have an error in your SQL syntax; check the manual that corresponds to your MySQL相关的知识,希望对你有一定的参考价值。

详细的异常信息如下

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 'describe,state) values('002','双人房',199,'精选双人房','空闲')' at line 1

查看了insert into t_room(code,room_type,deposit,describe,state) values('002','双人房',199,'精选双人房','空闲');语句语法没有问题

接着把语句房到MySQL工具去执行,也报错了

 百思不得其解

再看了一下,是的,describe的字体是蓝颜色的,和insert into values这些字的颜色是一样的,所以得出的结论就是describe是一个关键字,这也是为什么MySQL提倡用`col`这种写法的原因

把关键字改一下就行了description或者sql语句改关键字加上`describe`就行

以上是关于You have an error in your SQL syntax; check the manual that corresponds to your MySQL的主要内容,如果未能解决你的问题,请参考以下文章

1064 - You have an error in your SQL syntax;

Mysql错误 ERROR 1064 (42000): You have an error in your SQL syntax

Error:You have an error in your SQL syntax; TYPE=MYISAM

1064 - You have an error in your SQL syntax问题解决

Mysql排错:[Err] 1064 - You have an error in your SQL syntax;

MySQL错误[ERR] 1064 - You have an error in your SQL syntax;