我几乎尝试了所有方法来使我的第一个 Flask 任务在 cloud9 上运行,但仍然给我这个错误
cursor.execute('''INSERT INTO studentmaster
(Student_Id,Student_FirstName,Student_LastName,
Course_Id,Gender,Residential_Address,
PhoneNo,Email,Password)
VALUES (%s,%s,%s,%s,%s,%s,%s)''',
(stid,firstname, lastname, coursename, gender, address,
phone, email,password))
这是我的应用程序的链接 https://ide.c9.io/hunteelar/studentregistration#openfile-README.md
最佳答案
表名中有 9 列,值中有 9 个变量,但值中只有 7 %s (%s......%s)
cursor.execute('INSERT INTO studentmaster
(Student_Id,Student_FirstName,Student_LastName,Course_Id,Gender,Residential_Address,PhoneNo,Email,Password)
VALUES (%s,%s,%s,%s,%s,%s,%s)',
(stid,firstname, lastname, coursename, gender, address,phone, email,password))
关于python - Flask mysql 查询 = 查询% self._escape_args(args, conn) TypeError : not all arguments converted during string formatting,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43158988/