Python Forum
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing CSV into MySQL
#2
My best guess, without playing around with it, is that
        cursor.execute('INSERT INTO readings (ID, r_date, rtype, hist, scan) VALUES (?, ?, ?, ?, ?)',
                       row)
ought to be
        cursor.execute('INSERT INTO readings (ID, r_date, rtype, hist, scan) VALUES (?, ?, ?, ?, ?)',
                       row[:5])
Reply


Messages In This Thread
Importing CSV into MySQL - by gehrenfeld - Dec-24-2018, 03:43 PM
RE: Importing CSV into MySQL - by micseydel - Dec-26-2018, 11:08 PM
RE: Importing CSV into MySQL - by gehrenfeld - Dec-27-2018, 11:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Mysql and mysql.connector error lostintime 2 831 Oct-03-2023, 10:25 PM
Last Post: lostintime
  Mysql error message: Lost connection to MySQL server during query tomtom 6 16,755 Feb-09-2022, 09:55 AM
Last Post: ibreeden

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020