gpt4 book ai didi

python - Flask mysql 查询 = 查询% self._escape_args(args, conn) TypeError : not all arguments converted during string formatting

转载 作者:行者123 更新时间:2023-11-29 07:01:53 24 4
gpt4 key购买 nike

我几乎尝试了所有方法来使我的第一个 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com