1 import MySQLdb
2
3 db = MySQLdb.connect(host="127.0.0.1", port=3306, user="...", passwd="...", db="...")
4 cursor = db.cursor(MySQLdb.cursors.DictCursor)
5
6 sql = "select * from mytable"
7 cursor.execute(sql)
8
9 for row in iter(cursor.fetchone, None):
10 print row
Linux/Internet/Mail/Umsetzung (last edited 2010-01-07 15:06:19 by DetlevLengsfeld)