We can get all the details about the fields used in a table by using the mysql_fetch_field() function. This function returns an object and using that we can get required information about the field. Here in the query we have to specify the fields for which the detail information is required. We also can use symbol * to get information on all the fields of the table. If we are mentioning field names then we will only get details of those fields only.
Here we will use mysql_num_fields() to get the number of fields there in the table. Here is the code to display details of the fields.