尝试修复SQL语法中的错误;检查与MySQL服务器版本对应的手册以获得正确的语法

2024-04-25 13:06:52 发布

您现在位置:Python中文网/ 问答频道 /正文

def SignUp(self):
    n=self.lineEdit.text()
    m=self.lineEdit_2.text()
    us= self.lineEdit_4.text()
    pww = self.lineEdit_5.text()
    query=("insert into users(name,matric,username,password), values ('%s,%s,%s,%s)")
    cur.execute(query,(n,m,us,pww))
    cur.commit()

这是我为Python编写的代码。我正在使用PyQt设计器和MySql。 我不断得到错误ProgrammingError:您的SQL语法有一个错误;请检查与MySQL服务器版本对应的手册,以获得正确的语法,以便在第1行使用near',values('asdasda','asdasdasf','sdafdssa')。请帮忙


Tags: textselfdef错误语法queryusersus