$result_set->fetch_field;
mysqli_fetch_field
The input parameter $result_set is the output of result set identifier of mysqli_query(), mysqli_store_result() or mysqli_use_result().
MySQLI database connection file
Example : Object Oriented Style<?Php require "config.php";// Database connection file. $query="select * from student "; if ($result_set = mysqli_query($connection,$query)) { while ($field_details = mysqli_fetch_field($result_set)) { echo "
Name ".$field_details->name; echo "
Data Type ".$field_details->type; echo "
Max Length ".$field_details->max_length; echo "
Length ".$field_details->length; echo "
Flags ".$field_details->flags; echo "
Table ".$field_details->table; echo "
"; } } ?>
Name id Data Type 3 Max Length 2 Flags 32769 Table student Name name Data Type 253 Max Length 11 Flags 1 Table student Name class Data Type 253 Max Length 5 Flags 1 Table student Name mark Data Type 3 Max Length 3 Flags 32769 Table student Name sex Data Type 253 Max Length 6 Flags 1 Table studentProcedural style
<?Php require "config.php";// Database connection file. if ($result = $connection->query("SELECT * FROM student")) { while ($field_details = $result->fetch_field()) { echo "
Name ".$field_details->name; echo "
Data Type ".$field_details->type; echo "
Max Length ".$field_details->max_length; echo "
Flags ".$field_details->flags; echo "
Table ".$field_details->table; echo "
"; } $result->close(); } ?>