Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.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 Sqlite数据库没有';是否使用新值更新表?_Python_Sqlite - Fatal编程技术网

Python Sqlite数据库没有';是否使用新值更新表?

Python Sqlite数据库没有';是否使用新值更新表?,python,sqlite,Python,Sqlite,我的sqlite数据库没有更新,下面的代码验证currentusername是否存在,如果存在,则重定向到updateusername函数,该函数包含2个变量,currentusername是表中的旧值,newusername是应替换旧值的新值。但是,它不会更新数据库中的旧值 def ChangeUsername(self): loadUi("ChangeUsername.ui",self) self.SaveChangesButto

我的sqlite数据库没有更新,下面的代码验证currentusername是否存在,如果存在,则重定向到updateusername函数,该函数包含2个变量,currentusername是表中的旧值,newusername是应替换旧值的新值。但是,它不会更新数据库中的旧值

    def ChangeUsername(self):
        loadUi("ChangeUsername.ui",self)

        self.SaveChangesButton.setCheckable(True)

        self.SaveChangesButton.clicked.connect(self.CheckUsername)
        self.SaveChangesButton.clicked.connect(self.UpdateUserna

元组中的参数必须与sql语句中的参数顺序完全相同:

c.execute('UPDATE Account SET username = ? WHERE username = ?',(self.newusername,self.currentusername,))

元组中的参数必须与sql语句中的参数顺序完全相同:

c.execute('UPDATE Account SET username = ? WHERE username = ?',(self.newusername,self.currentusername,))