title: MySQL Python update rows
body: <p>I am trying to update the data in a row of MySQL which this line of code is throwing this error. </p>
  
  <pre><code>for k in range(city_count):
      cur.execute("UPDATE hqstock SET citylastprice = '%s' WHERE id = '%s'"%(CITYPRICE[k],   tID[k]))
  </code></pre>
  
  <p>The error that was returned: </p>
  
  <pre><code>File "C:\Python27\lib\site-packages\MySQLdb\cursors.py", line 201, in execute
      self.errorhandler(self, exc, value)
  File "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in defaulterrorhandler
      raise errorclass, errorvalue
  InterfaceError: (0, '')
  </code></pre>
  
  <p>This is my table structure.</p>
  
  <pre><code>+--------------------+------------------+------+-----+---------+-------+
  | Field              | Type             | Null | Key | Default | Extra |
  +--------------------+------------------+------+-----+---------+-------+
  | id                 |int(11) unsigned  | NO   | PRI | NULL    |       |
  | barcode            | char(15)         | YES  |     | NULL    |       |
  | citycurstock       | smallint(6)      | YES  |     | NULL    |       |
  | citylastprice      | demical(4,2)     | YES  |     | NULL    |       |
  | city               | varchar(60)      | YES  |     | NULL    |       |
  +--------------------+------------------+------+-----+---------+-------+
  </code></pre>
  
  <p>Anybody knows what is wrong with my query statement? or why doesn't this work?</p>