How to use mysql field seek in PHP
In this article I am going to explain about mysql_field_seek function in PHP.
PHP mysql_field_seek() Function
The PHP mysql_field_seek function is used to moves the result pointer to a specified field.
Syntax of mysql_field_seek function
mysql_field_seek(data, fieldOffset) |
Parameters in mysql_field_seek function
It have two parameter:
Parameter |
Description |
data |
It specifies which data pointer to use. |
fieldOffset |
It specifies which field to moves to. |
Example of mysql_field_seek 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");
$row = mysql_fetch_object($res);
echo $row->Fname . ' ' . $row->LastName;
echo "<br/>" ;
mysql_field_seek($res,2);
$row = mysql_fetch_object($res);
echo $row->Fname . ' ' . $row->LastName;
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