What is mysql data seek in PHP

In this article I am going to explain about mysql_data_seek(() function in PHP.
  • 3230

PHP mysql_data_seek() Function

The PHP mysql_data_seek function move internal result pointer.

Syntax of mysql_data_seek function

mysql_data_seek(data, row)


Parameters in
mysql_data_seek function

It have two parameter:
 

Parameter Description
data It specifies which data pointer to use.
row It specifies desired row number of the new result pointer.

Example of mysql_data_seek function

<html>

<body>

<?php

$con=mysql_connect("localhost","gupta","sharad");

if(!$con)

{

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

}

$SelDatabase= mysql_select_db("Mcn_Solution", $con);

$qry="select * from Emp";

$res=mysql_query($qry, $con);

print_r(mysql_fetch_row($res));

mysql_data_seek($res,2);

print_r(mysql_fetch_row($res));

mysql_close($con);

?>

</body>

</html>


Output:

mysql-data-seek-php.jpg

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

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.