Ask Mysqli to get the field name of the specified field in the result

Source: Internet
Author: User
Ask Mysqli to obtain the field name of the specified field in the result
Mysqli the field name of the specified field in the result is not found in the manual. Seek expert answers

Share to:


------Solution--------------------
Data from the database, not an array.

is an array of key values that are numbers

The field depends on the order of the fields when you query!!!
------Solution--------------------
There seems to be a function called
Mysql_field_name ();

This function can return the field name of the resource set

is if you execute the SQL query first
Save the results of the query to a variable
Take this variable and an integer as a parameter
Pass in this function
The integer number should be the offset to get the field name

Like you passed 0.
Mysql_field_name ($res, 0);
Starting from the first field name of the $res dataset.

Specifically, you can search for the use of this function
or test it yourself.

Try it out with a little bit.

  • 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.