Home > other >  Python in the import database times wrong: not all the arguments converted during string formatting,
Python in the import database times wrong: not all the arguments converted during string formatting,

Time:09-24

When importing data to the database to the fault, the SQL statement is as follows:
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 % s

CodePudding 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 output

 SQL="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
  • Related