开发者社区> 问答> 正文

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

我要往两个表里更改这些信息,但是出错了。不知道怎么错了

展开
收起
蛮大人123 2016-03-24 16:35:46 2027 0
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪

    update 语法:
    `update userinfo
    set userinfo = "111"
    ,gender ="222"`

    2019-07-17 19:13:03
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
搭建电商项目架构连接MySQL 立即下载
搭建4层电商项目架构,实战连接MySQL 立即下载
PolarDB MySQL引擎重磅功能及产品能力盛大发布 立即下载

相关镜像