Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 是否将数据插入特定的Sqlite3数据库行?_Python_Sql_Database_Sqlite - Fatal编程技术网

Python 是否将数据插入特定的Sqlite3数据库行?

Python 是否将数据插入特定的Sqlite3数据库行?,python,sql,database,sqlite,Python,Sql,Database,Sqlite,从逻辑上说,我本以为这会奏效,但我不知道为什么它没有奏效? sql语句中的第一个“?”与“a”相同。 我得到这个错误: 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数据库中已经写入的行?INS

从逻辑上说,我本以为这会奏效,但我不知道为什么它没有奏效? sql语句中的第一个“?”与“a”相同。 我得到这个错误:

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数据库中已经写入的行?

INSERT
意味着添加一个全新的行。如果要更改现有行,则需要
UPDATE

比如说

更新用户
设置用户密码=?,
用户_wins=?,
用户_丢失=?
其中user_name=?
将用户名作为最后一个变量传递

比如:

sqlite3.OperationalError: near "where": syntax error

INSERT
表示添加一个全新的行。如果要更改现有行,则需要
UPDATE

比如说

更新用户
设置用户密码=?,
用户_wins=?,
用户_丢失=?
其中user_name=?
将用户名作为最后一个变量传递

比如:

sqlite3.OperationalError: near "where": syntax error

INSERT
表示添加一个全新的行。如果要更改现有行,则需要
UPDATE
INSERT
意味着添加一个全新的行。如果要更改现有行,则需要
UPDATE