0
我使用这下面的代码来更新我的表中的记录,但它不工作,并没有更新我的表Python的MYSQL更新
conn = mysql.connector.connect(host='localhost',
database='rps',
user='root',
password='')
cur = conn.cursor()
cur.execute("""UPDATE players SET score=%s WHERE chat_id =%s""", (int(self.p1.score), str(self.p1.chat__id)))
cur.execute("""UPDATE players SET score=%s WHERE chat_id =%s""", (int(self.p2.score), str(self.p2.chat__id)))
conn.commit()
cur.close()
conn.close()
这是完全正确的,但我不知道如何解决这个问题 你能帮我解决它吗? 感谢
没有人不知道答案? – mahdi