mysql_fetch_array will return an indexed-associative array so you can use the index to find out the key of each field returned.
$row = mysql_fetch_array($result);
$row is now an array so you can use all array functions
array_keys will return all the keys so you've got the field names
or just do something like this
foreach ($row as $key=>$val ) {
$key give you the column name
You could also compare array keys of $row with an array that lists all the possible columns, you would then have an exception list of columns NOT returned which would be very usefull for conditional display where format and data type is an issue.