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.