db.commit() to take effect
progman
hong.file at gmail.com
Sun Dec 3 00:29:41 EST 2006
More information about the Python-list mailing list
Sun Dec 3 00:29:41 EST 2006
- Previous message (by thread): Non-exhaustive file reads
- Next message (by thread): db.commit() to take effect
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I was testing the python+mysql
here are my sample codes:
------------------------
import MySQLdb
from pprint import pprint
db = MySQLdb.connect(host="localhost", user="root", passwd="password",
db="database")
cursor = db.cursor()
cursor.execute('update promo set date=100")
------------------------
i was expecting the cursor.execute will update my db immediately.
it wasn't. not until i run db.commit(), then only i see the value
changes.
it that the right way to update db?
- Previous message (by thread): Non-exhaustive file reads
- Next message (by thread): db.commit() to take effect
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list