| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1607 人关注过本帖
标题:代码报错解决不了了
只看楼主 加入收藏
wuhuiiii
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-3-25
收藏
 问题点数:0 回复次数:2 
代码报错解决不了了
cmd='SELECT `card` FROM  `userdata` WHERE `card` = %s'%card#命令:在数据库搜索刚刚输入的卡号
     passwordmd=md5.new()
     passwordmd.update(password)
 if userdbcmd(cmd)==0:         #没有找到相同的卡号
     self.response.write(r"""<a>卡号错误<a><p><a href="/">返回<p>""")
     raise UserError
 else:
     cmd1='SELECT `password_1` FROM  `userdata` WHERE `password_1` = %s'%password  #命令:在数据库搜索刚刚输入的密码
     if userdbcmd(cmd1)==0:           #没有找到相同的密码
         self.response.write(r"""<a>密码错误<a><p><a href="/">返回<p>""")
     else:
         self.response.write(r"""<a>登录成功<a><p><a href="/">返回<p>""")
 except UserError:
            pass
会报错:
Traceback (most recent call last):
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/webapp2.py", line 1536, in __call__
    rv = self.handle_exception(request, response, e)
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/webapp2.py", line 1530, in __call__
    rv = self.router.dispatch(request, response)
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/home/bae/instanceall/instance0/codefs/0.fanxianle., line 82, in post
    userdbcmd(cmd3,1)
  File "/home/bae/instanceall/instance0/codefs/0.fanxianle., line 23, in userdbcmd
    cursor.execute(cmd)
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/home/bae/instanceall/instance0/pyruntime/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
ProgrammingError: (1064, "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 ''password','card', `gender`,  `iffanxian`, `address`,'ifzhuce') VALUES ('guo', '1' at line 1")

[ 本帖最后由 wuhuiiii 于 2013-4-19 23:28 编辑 ]
搜索更多相关主题的帖子: password 数据库 密码 
2013-03-29 20:52
evilloop
Rank: 2
等 级:论坛游民
帖 子:36
专家分:22
注 册:2011-8-27
收藏
得分:0 
楼主,你不把报错信息发全了怎么看
2013-04-10 16:19
wuhuiiii
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-3-25
收藏
得分:0 
回复 2楼 evilloop
不好意思,之前一直在忙,现在把错误都贴出来了,主要是我想只在指定列插入值,其他列的值保持不变。谢谢你了先
2013-04-19 23:31
快速回复:代码报错解决不了了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017037 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved