title: UPDATE and INSERT don't work in Python
body: <p>I use this code to retreive an id. It works:</p>
  
  <pre><code>        db = MySQLdb.connect("localhost","root","","proyectoacademias" )
  
          cursor = db.cursor()
  
          sql = "SELECT id FROM test WHERE url=\'"
          sql = sql + self.start_urls[0]
          sql = sql + "\'"
  
          cursor.execute(sql)
  
          data = cursor.fetchone()
  
          for row in data:
              self.id_paper_web=str(row)
  
          db.close()
  </code></pre>
  
  <p>It gives me the id of the current row I have to update...</p>
  
  <p>But then I try to update or to insert, it doesn't work....</p>
  
  <pre><code>    def guardarDatos(self):
      db = MySQLdb.connect("localhost","root","","proyectoacademias" )
  
      cursor = db.cursor()
  
      sql = "UPDATE test SET abstract=\'"+str(self.abstracto)+"\', fecha_consulta=\'"+str(self.fecha_consulta)+"\', anio_publicacion=\'"+str(self.anio_publicacion)+"\', probabilidad="+str(self.probabilidad)+" WHERE id = "+str(self.id_paper_web)
  
      print "\n\n\n"+sql+"\n\n\n"
      cursor.execute(sql)      
  
      for i in range (len(self.nombres)):
          sql = "INSERT INTO test_autores VALUES (\'"+self.nombres.keys()[i]+"\', "+str(self.id_paper_web)+", \'"+self.instituciones[self.nombres[self.nombres.keys()[i]]]+"\', "+str((i+1))+")"
          print "\n\n\n"+sql+"\n\n\n"
          cursor.execute(sql)
  
      db.close()
  </code></pre>
  
  <p>I print every sql query I sent and they seem to be fine... no exceptions thrown, just no updates or inserts in the database...</p>