Given the set of results, how can I determine the actual names of the fields specified in the query (NOT their aliases).
$query = "SELECT first AS First_Name, last AS Last_Name FROM people"; $dbResult = mysql_query($query); $fieldCount = mysql_num_fields($dbResult); for ($i=0; $i<$fieldCount; $i++) { // Set some values $fieldName = mysql_field_name($dbResult, $i); }
In this example, field names are returned, but in this example, it returns the alias "First_Name" instead of the actual field name "first".
Is it possible to get the actual field name from such a query. In particular, if I write a function and do not know what request will be thrown at it.
source share