I'm new to MySQLdb and Python. I'm trying to execute the following statement:
header_string = 'number_one, number_two, number_three'
values = '1, 2, 3'
cursor.execute("""INSERT INTO my_table (%s) VALUES (%s)""", (header_string, values))
and it returns with the following error:
Error: 1064 "You have an error in your SQL syntax."
From my limited understanding of MySQLdb the above execute statement should execute the following SQL statement:
INSERT INTO my_table (number_one, number_two, number_three) VALUES (1, 2, 3)
Any ideas what I might be doing wrong?