<p>Hi,<br>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?<br>Code Snippet:</p>
<p>     query="select * from employees"<br>     db=MySQLdb.connect(host=host,user=user,passwd=passwd,db=database)<br>     cursor = db.cursor ()<br>     cursor.execute (query)<br>     rows = cursor.fetchall ()</p>

<p>      for row in rows:<br>               print row[0]<br>               </p>
<p>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.<br>Something like row.get('employee_id')<br>Is something of the sort possible with Mysqdb?<br>
Thanks very much.</p>