conn = MySQLdb.Connect( host='localhost', user='root', passwd='', db='test',compress=1, cursorclass=MySQLdb.cursors.DictCursor)or
cursor = conn.cursor(cursorclass=MySQLdb.cursors.DictCursor)
Reference :
MySQL and accessing database results by field « Python recipes « ActiveState Code
沒有留言:
張貼留言