mysql_num_fields() function code example Example: mysql_num_fields in mysqli $fieldcount=mysqli_num_fields($result);