INSERT INTO xf_solve_equip_tp (
'id',
'userId',
'userName',
)VALUES(
'123123',
'123123',
'13421'
)
数据库报错如下:
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 ‘‘id’,
‘userId’,
‘userName’,
)VALUES(
‘123123’,
‘123123’,
‘13421’
)’ at line 2
此处是个坑,他并不是id或者是双引号的错误,而是单引号问题,正确阅读方式是
the manual that corresponds to your MySQL server version for the right syntax to use near ’
‘id’,主要的问题就是我们的SQL语句不支持用引号包裹字段
正确的符号是:
`id`, `user_id`, `user_name`
注意和上边引号的区别