Find the field name of the specified field in the mysqli result. The field name & nbsp; which is the name & nbsp; not found in the manual: evaluate the field name of the specified field in the result obtained by mysqli
The field name specified in the result obtained by mysqli is not found in the manual.
Share:
------ 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 !!!
------ Solution --------------------
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.