import MySQLdb import MySQLdb.cursors conn = MySQLdb.Connect( host='localhost', user='user', passwd='secret', db='test') cursor = conn.cursor(cursorclass=MySQLdb.cursors.DictCursor) cursor.execute("SELECT this,that FROM foobar") rows = cursor.fetchall() for row in rows: print row['this'], row['that'] cursor.close() conn.close()
Please suggest -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.