[python-nl] INSERT statement met MySQLdb

Math mathweijzen at home.nl
Sun Jan 29 18:32:09 CET 2006


Hallo allen,

Kan iemand mij uithelpen met het volgende;
Ik voer een SQL INSERT commando uit in Python maar het record wordt niet in de MySQL DataBase opgeslagen.
Wanneer ik het commando uitvoer, zie ik inn MySQL Administrator wel de toegevoegde rij verschijnen, maar
zodra ik het Python programma sluit is het aantal rijen weer 0.

Hier de code:
          conn = MySQLdb.connect(host="localhost",user="root",passwd="admin",db="marathon")
          curs = conn.cursor()
          statement = "INSERT INTO deelnemers (naam) VALUES ('Math');"
          curs.execute(statement)
          curs.close()
          conn.close()

Alvast bedankt
-------------- next part --------------
Er is een HTML-bijlage verwijderd...
URL: http://mail.python.org/pipermail/python-nl/attachments/20060129/776bed4f/attachment.html 


More information about the Python-nl mailing list