Get column alias : Query Result « MySQL Database « PHP






Get column alias

<?php
   mysql_connect("mysql153.secureserver.net","java2s","password");
   mysql_select_db("java2s");

   $query = "SELECT FirstName as First_Name FROM Employee";
   $result = mysql_query($query);
   $row = mysql_fetch_row($result);
   echo mysql_field_name($result, 0);

?>


           
       








Related examples in the same category

1.From result row get the table name
2.Use mysql_result function to get query result
3.Store query result in an array
4.Use for loop to read all query result
5.use Column name in select statement as the variable name
6.Store query result in an Object
7.Store query result in an associate array
8.Get returned row count