最近写一个小案例,出现了如下问题:
code: ‘ER_PARSE_ERROR’,
errno: 1064,
sqlMessage: “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 ‘=1’ at line 1”,
sqlState: ‘42000’
网上也是找了一下午,代码也检查了老半天,一直反反复复,
最终还是解决了
首先我检查了单词,引号,空格都没有错,下面就是我的问题
select age,sex from userinfo id=? //我写的错误代码
select age,sex from userinfo where id=? //正确代码
看了一下午居然是少写了一个where,
这是我在网上找的 在线sql检测工具