在mysql里插入数据报错“ERROR 1064 (42000): You have an error in your SQL syntax; ”?
在MySQL终端运行指令
insert into app03_accountcontrol(mobiles,price,level,use)values("1231231231",123.11,1,1);
这是我在pycharm里Django中models.py里写的类
这是app03_accountcontrol数据表的描述
我想在数据表中插入数据,结果运行指令报错
ERROR 1064 (42000): 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 'use)values("1231231231",123.11,1,1)' at line 1
请问各位大佬,这到底错在哪里
回复
1个回答

test
2024-07-01
insert into app03_accountcontrol(mobiles,price,level,`use`) values("1231231231",123.11,1,1);use是mysql的保留关键词,需要带上反引号
回复

适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容