Does any one know how can I find the column name for a selected table in php?
Exmaple:
If i have a table call customer as below:
cust_id cust_name cust_age
1 Alan 35
2 Alex 52
3 Amy 15
How can I get the column name only in php when I select customer table (which it will return me value are cust_id, cust_name and cust_age)?
If your database is MySQL then, you can use mysql_field_name() and mysql_fetch_field() function in php.
You can check this http://php.net/manual/en/function.mysql-field-name.php
If you want other information for fields then check this out
https://www.php.net/manual/en/function.mysql-fetch-field.php