You are passing in each argument separately to execute()
, where it only takes two.
cursor.execute("INSERT INTO table (field1, field2, field3) VALUES(%s, %s, %s)",
(var1, var2, var3))
Now, you are passing it two arguments. The first is a string, and the second is a tuple
of your variables (notice the extra ()
).