SQL="insert into foreign (date, province, confirmed, cured_num, dead_num) values (?,?,?,?,? ,? ,? ,? ,?) "% (Date, Province, Confirmed_num Cured_num, Dead_num)
cursor.execute(sql)
CodePudding user response:
? Take a look at to % sCodePudding user response:
Will report the error to % s:You have an error in your SQL syntax; Check the manual that corresponds to your MySQL server version
CodePudding user response:
After changed to % s, and print, look at what SQL is formatted outputSQL="insert into foreign (date, province, confirmed, cured_num, dead_num) values (% s, % s, % s, % s, % s)" % (date, province, Confirmed_num cured_num, dead_num)
Print (" SQL=% s "% SQL)
Post, and then help you to analyze why wrong, wrong