mysql_num_fields()
unsigned int mysql_num_fields(MYSQL_RES *result)
This function returns the number of fields in each row of a
results set. It is similar to
mysql_field_count() except that that function
operates on the MYSQL handle and not the results
set. Here is an example:
... unsigned int num_fields = mysql_num_fields(result); ...
See mysql_fetch_lengths() earlier in
this section for a more elaborate example that uses this
function.