I have the following quesry, where the variables are arrays...
c.execute("INSERT into userData values=(%s,%s,%s,%s,%s,%s)",
t[i],k[0],k[1],k[2],user[i],total)
This gives a syntax error.
I have also tried this:
a = "INSERT INTO userData VALUES ('"+t[i]+"','"+k[0]+"','"+k[1]+"','"+k[2]+"',
'"+USER+"','"+total+"')"
c.execute(a)
conn.commit()
This does not update to the database, though there are no errors.
Note: c - cursor, conn - connection.
c.excecute("INSERT into userData values(%s,%s,%s,%s,%s,%s)",( t[i],k[0],k[1],k[2],user[i],total))it is beacause the second parameter to execute model is tuple of arguments and there is no need for=