self.cursor.execute('INSERT INTO User where User_name=(?) (user_name,user_password,user_wins,user_loses) VALUES(?,?,?,?)',(a,a,b,c,d))
self.connect.commit()
从逻辑上说,我本以为这会奏效,但我不知道为什么它没有? sql语句中的第一个“?”与“a”相同。 我得到这个错误:
sqlite3.OperationalError: near "where": syntax error
所以我想知道是否真的有可能写入SQL数据库中已经写入的行
INSERT
表示添加一个全新的行。如果要更改现有行,则需要UPDATE
例如
将用户名作为最后一个变量传递
比如:
相关问题 更多 >
编程相关推荐