pymysql.err.InternalError: (1054, "Unknown column 'user' in 'where clause'")

pymysql.err.InternalError: (1054, "Unknown column 'user' in 'where clause'")问题和解决方法

问题代码

sql="select * from user where name=%s"%a
把%s加上引号就可以了
name='nhy'
sql="select * from user where name='%s'"%name

猜你喜欢

转载自www.cnblogs.com/jingw/p/11222890.html
今日推荐