问题描述
- mysql语句这样有错误问题出在哪?
- 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
我要往两个表里更改这些信息,但是出错了。初学者,不知道怎么错了
解决方案
update 语法:
update userinfo
set userinfo = ""111""
gender =""222""
解决方案二:
update 语法:
update userinfo
set userinfo = ""111""
gender =""222""
解决方案三:
SQL syntaxsql语法错误
update user loginName='""+uloginName+""'userName='""+userName+""' where loginName='""+loginName+""'""
例如:update 表名
set name = ""zhang""(要修改的属性和值修改name值为""zhang"")
where id = ""3""(条件id=3);
解决方案四:
你的表名是from是关键字,所以出错了。
解决方案五:
很明显,update语法错误
解决方案六:
mysql 语句错误