首页 >数据库 >mysql教程 >java-mysql语句这样有错误问题出在哪?

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

WBOY
WBOY原创
2016-06-06 09:35:101128浏览

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
我要往两个表里更改这些信息,但是出错了。初学者,不知道怎么错了

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn