Home > other >  Python error when importing data to the database, a great god help point out mistakes
Python error when importing data to the database, a great god help point out mistakes

Time:09-24

(1064, "You have an error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near 'foreign values (' 03.21', 'Iran', 11419763, 5155, 6) "at line 1")
The SQL statement is:
SQL="insert into foreign (date, province, confirmed, cured_num, dead_num) values (% s, % s, % s, % s, % s)"
Cursor. The execute (SQL, (date, province, confirmed_num cured_num, dead_num))

CodePudding user response:

Altered according to some of the online tutorials, after prompt SQL statement error no longer, but will appear this error:
Not all the arguments converted during string formatting
SQL statements are 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 be submitted to the first error to % s

CodePudding user response:

Can use the format, which is intuitive

CodePudding user response:

The structure of the foreign post,
  • Related