What is mysql result in PHP
In this article I am going to explain about mysql_result function in PHP.
PHP mysql_result() Function
The PHP mysql_result function is used to returns the value of a field in a recordset.
Syntax of mysql_result function
mysql_result(data, row, field) |
Parameters in mysql_result function
It have three parameter:
Parameter |
Description |
data |
It specifies which result handle to use. |
row |
It specifies the row number from the result that is being retrieved. |
query |
It specifies the name or offset of the field being retrieved. |
Example of mysql_result function
<?php
$con=mysql_connect("localhost","gupta","sharad");
if(!$con)
{
die("Could not connect:".mysql.error());
}
mysql_select_db("mcn_solution",$con);
$res=mysql_query("select * from emp",$con);
echo mysql_result($res,0);
mysql_close($con);
?
|
Output

You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here