MySQL Tutorial: Reading the Data table field name Mysql_fetch_field () _php Tutorial

Source: Internet
Author: User
Tags mysql tutorial
Now let's take a look at the Mysql_fetch_field () function, which is to read the MySQL data table's example name, the field name. Let's take a look at its syntax.

Mysql_fetch_field (Data,field_offset)

The Mysql_fetch_field () function pairs like a recordset that returns a. mysql_query () function and returns success on an object, or false or failed

He has two parameters. Data and Field_offset

Data: Required if, the specified pointer is used. The data pointer is due to the mysql_query () function

Field_offset: Optional, from which record to start reading, do not write is code starting 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 result of the output is the name of all the fields in your data table.

http://www.bkjia.com/PHPjc/630897.html www.bkjia.com true http://www.bkjia.com/PHPjc/630897.html techarticle now let's take a look at the Mysql_fetch_field () function, the function is to read the MySQL data table example name, field name. Let's 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.