MySQLdb DictCursor scrambles field order

HW google at thegoldensun.com
Wed Jul 31 00:37:29 EDT 2002


Hello,

I am viewing some MySQL tables via Python CGI; I use the
MySQLdb.DictCursor in order to return the field names as well as the
data, so I can output a table with the field names as column headings.

Unfortunately, the DictCursor seems to scramble the order of fields,
eg:
"SELECT field1, field2, field3 FROM table"
which returns the fields in order when using a standard cursor, seems
to rearrange the order (randomly?) with a DictCursor.

I am using MySQLdb 0.9.1, Python 2.1, 3.23.51-nt under Win XP; I have
had the same trouble in a similarly numbered Linux version.

Thanks for any help!

HW



More information about the Python-list mailing list