当前位置:Gxlcms > mysql > java-mysql语句这样有错误问题出在哪?

java-mysql语句这样有错误问题出在哪?

时间:2021-07-01 10:21:17 帮助过:7人阅读

mysqljava

sql语句:
String tel = obj.getString("tel");
String email = obj.getString("email");
......
sqls.add("update from user loginName='"+uloginName+"',userName='"+userName+"' where loginName='"+loginName+"'");

sqls.add("update from userinfo loginName='"+uloginName+"',gender='"+gender+"',birthday='"+birthday+"',address='"+address+"', mobile='"+mobile+"',tel='"+tel+"',email='"+email+"',quanpin='"+CHNUtil.getFullSpell(userName)+"',jianpin='"+CHNUtil.getFirstSpell(userName)+"' where loginName='"+loginName+"'");
错误信息:
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 'from userinfo loginName='s123',gender='0',birthday='2015-12-10',address='1111',m' at line 1
我要往两个表里更改这些信息,但是出错了。初学者,不知道怎么错了

人气教程排行