数据库中表名或字段出现关键字

当数据库中表名出现关键字,操作数据库时就会发生错误。如图:


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 'order (Userid,movieid,hallid,spietltagid,seat,price,date) VALUES (1,4,4,7,6,50,'' at line 1

原因时mysql中的关键字order做字段,查询的时候可以用  `` 来括起来,该符号是键盘数字一行键的最左边,在英文状态下的为 ` ,让其把关键字括起来就可以用了。

猜你喜欢

转载自blog.csdn.net/abandon_li/article/details/80627147