mysqli_fetch_field() : All field details

$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().

The output is an object array containing all field defination information, returns FALSE if not available.

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 student

MySQL SELECT Query

Procedural 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(); } ?>

MySQL DUMP of student table

Your Rating





Post your comments , suggestion , error , requirements etc here .




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer