title: Python, mySQL with variables
body: <p>I have the following quesry, where the variables are arrays...</p>
  
  <pre><code>c.execute("INSERT into userData values=(%s,%s,%s,%s,%s,%s)",
              t[i],k[0],k[1],k[2],user[i],total)
  </code></pre>
  
  <p>This gives a syntax error.</p>
  
  <p>I have also tried this:</p>
  
  <pre><code>a = "INSERT INTO userData VALUES ('"+t[i]+"','"+k[0]+"','"+k[1]+"','"+k[2]+"',
    '"+USER+"','"+total+"')"
  c.execute(a)
  conn.commit()
  </code></pre>
  
  <p>This does not update to the database, though there are no errors.
  Note: <code>c</code> - cursor, <code>conn</code> - connection.</p>