这是在vscode中运行的,可以看到是运行成功了
这是在Python中写的sql语句(Python中的是我从上面那个复制过来的!)
sql1 = "update treasons set `Rr`='去过低风险区',`Rmethod`='三天两检' where Rsno='12345';"
运行时报错如下
他好像把我的值识别成我的属性了很奇怪(事实上我死马当活马医给他前后换了个顺序然后显示sql语句错误)
解决了。。。
虽然不知道发生了啥,但是能顺利运行了。。就这样吧赶作业要紧
之前的代码:
sql1 = "update treasons set `Rr`='去过低风险区',`Rmethod`='三天两检' where Rsno='12345';"
cursor.execute(sql1)
现在的:
sql1 = "update treasons set `Rr`=%s,`Rmethod`=%s where Rsno=%s;"
cursor.execute(sql1,(rr,me,no))