Evaluate the field name of the specified field in the result obtained by mysqli

Source: Internet
Author: User
Find the field name of the specified field in the mysqli result.


Reply to discussion (solution)

The data from the database, isn't it an array.

Is an array of keys and numbers.

The field depends on the order of the fields you query !!!

It seems that there is a function called
Mysql_field_name ();

This function returns the field name of the resource set.

That is, you first run the SQL query
Save the query result to a variable.
Use this variable and an integer as the parameter.
Input this function
The integer value should be the offset of the field name.

For example, if you input 0
Mysql_field_name ($ res, 0 );
It is obtained from the first field name of the $ res dataset.

You can search for the usage of this function.
Or test it by yourself.

Try it.

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.