请教下老师,为什么用终端登陆会显示密码错误?

来源:1-7 实战:实现新闻管理系统的查询待审批新闻分页功能

MrNeal1203

2019-08-02 00:39:56

http://img.mukewang.com/climg/5d43157f0001125304920110.jpg

http://img.mukewang.com/climg/5d43157f0001df6007350466.jpg

http://img.mukewang.com/climg/5d43157f00011aad18010678.jpg


写回答

1回答

时间,

2019-08-02

同学,你好。同学sql语句中and和password间缺少空格导致sql语句不正确,

http://img.mukewang.com/climg/5d439d4e00015caa05090089.jpg

http://img.mukewang.com/climg/5d439d5e0001982f02290042.jpg

如果我的回答解决了您的疑惑,请采纳!祝学习愉快~~~~

0
hrNeal1203
h sql="select count(*) from t_user where username=%s and " \ "password = %s" cursor.execute(sql,(username,password)) count = cursor.fetchone()[0] return True if count == 1 else False except Exception as e: print(e) finally: if "con" in dir(): con.close() 老师,好像还是不行
h019-08-02
共1条回复

0 学习 · 2669 问题

查看课程