title: How to insert values in mysql from loop in Python
body: <p>In MySQL I have create db with name "test" and one table with name "table". Table have one column name: "A" and set as datatype INT(1).</p>
  
  <p>In Python I have this code:</p>
  
  <pre><code>import MySQLdb
  db = MySQLdb.connect(host="localhost",
                   user="root",
                   db="test")
  
  cur = db.cursor()
  
  myList = [1,2,3,4]
  for row in myList:
     print row
     cur.execute("INSERT INTO table (a) VALUES (%s)" % row)
  </code></pre>
  
  <p>Goal from code above is after loop is finish my table "table" shoud have data like this:</p>
  
  <pre><code>|A|
  |1|
  |2|
  |3|
  |4|
  </code></pre>
  
  <p><strong>But</strong> my table is empty after refresing. So my question is how to insert into table from loop in Python</p>
  
  <p>Tnx</p>