You can call the mysql_fetch_field_direct() function to return the field with the specified field number.
Syntax
MYSQL_FIELD *
mysql_fetch_field_direct(MYSQL_RES *result,
unsigned int fieldnr)
The value of fieldnr ranges from 0 to mysql_num_fields(result)-1.
Return values
The MYSQL_FIELD structure for the specified column is returned.
Errors
None.
Notes
You can use this function to retrieve the definition for an arbitrary column. Given a field number fieldnr for a column in a result set, this function returns that column's field definition as a MYSQL_FIELD structure.