Mysql Tutorial: Read Data Table field name mysql_fetch_field () _ PHP Tutorial

Source: Internet
Author: User
Tags mysql tutorial
Mysql Tutorial: read the data table field name mysql_fetch_field (). Now let's take a look at the mysql_fetch_field () function. this function reads the instance name and field name of the mysql data table. let's take a look at its syntax. mysql_fetch_field (data, field_o now let's take a look at the mysql_fetch_field () function. this function reads the instance name and field name of the mysql data table. let's take a look at its syntax.

mysql_fetch_field(data,field_offset)

Mysql_fetch_field ()For example, if the record set returns the. mysql_query () function and returns the success of an object, or if it is FALSE or fails

It has two parameters:. data and field_offset.

Data: Required. the specified data pointer is used. The data pointer is generated from the mysql_query () function.

Field_offset: (optional) the record to read from. If this parameter is left blank, the code starts from 0.

Now let's look at a mysql_fetch_field instance.

$sql = "SELECT * from a";
 
$result = mysql_query($sql,$con);

While ($ property = mysql_fetch_field ($ result) {echo "Field name:". $ property-> name ."
";}

The output result is the name of all fields in your data table.

Mysql_fetch_field () function. this function reads the instance name and field name of the mysql data table. let's take a look at its syntax. mysql_fetch_field (data, field_o...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.