Hi,
Is there a way of retrieving the value of columns in the rows returned by
fetchall, by column name instead of index on the row?
Code Snippet:

     query="select * from employees"
     db=MySQLdb.connect(host=host,user=user,passwd=passwd,db=database)
     cursor = db.cursor ()
     cursor.execute (query)
     rows = cursor.fetchall ()

      for row in rows:
               print row[0]


Instead of specifying the index of the row to retrieve the first column
(row[0]), I'd like to retrieve the value of the first column by column name.
Something like row.get('employee_id')
Is something of the sort possible with Mysqdb?
Thanks very much.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to