mysql_field_name()

It returns the name of a field in a recordset

Example

<?php
mysql_connect(“localhost”, “root”, “phpcode”) or die(mysql_error());
mysql_select_db(“database_name”);
echo “<pre>”;
echo mysql_field_name(mysql_query(“SELECT * FROM users”),1);
?>

Output

name