How to use mysql field name in PHP

In this article I am going to explain about mysql_field_name function in PHP.
  • 1787

PHP mysql_field_name() Function

The PHP mysql_field_name function is used to returns the name of a field in a recordset. It returns field name on success, or false on failure.

Syntax of mysql_field_name function

mysql_field_name(data, fieldOffset)

Parameters in mysql_field_name function

It have two parameter:

Parameter Description
data It specifies which data pointer to use.
fieldOffset It specifies which field to start returning.

Example of mysql_field_name function





die("Could not connect:".mysql_error());



$qry=mysql_query("select * from Emp");




echo "Emp table First Column is denoted by:  ".$FirstName;

echo "<br/>";

echo "Emp table Second column is denoted by:  ".$LastName;

echo "<br/>";

echo "Emp table Thrid column is denoted by:  ".$Id;





You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.