In Oracle I know you can issue the query:
"Describe tablename;"
which prints out a list of each field in a table and its parameters. If that's available to you, it would work.
Also, you have available the following:
mysql_field_name( $resultset , $columnindex )
Using this, you can see that you can get the name of a field at a given position (so giving columnindex 1 would give you the field name of column 1, and so on.