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.
['https://Stackoverflow.com/questions/35648453', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3788972/']
[`cursor.execute()`](http://mysql-python.sourceforge.net/MySQLdb.html#cursor-objects) expects the query parameters as a tuple. Try this:

```
cursor.execute("INSERT INTO userData VALUES (%s, %s, %s, %s, %s, %s)",
               (t[i], k[0], k[1], k[2], user[i], total))

```

Don't use `+` or the like for constructing SQL queries, as this can lead to SQL-injection vulnerabilities in your code.
Maybe try with the following syntax:

```
INSERT INTO table(col1,col2,...)VALUES(val1,val2,...)

```