import MySQLdb # Create a connection object and create a cursor conn = MySQLdb.Connect(host="localhost", port=3306, user="mysql", passwd="pwd123", db="mytest") c = conn.cursor()
# execute some SQL c.execute("SELECT * FROM mystuff") # Fetch all results from the cursor into a sequence results = c.fetchall() for r in results: do_something(r) # close the connection conn.close() Cheers, Miklos -- Software development: Python,Zope,Plone,PDF,XML,MivaScript http://www.jegenye.com -- http://mail.python.org/mailman/listinfo/python-list