Home  >  Article  >  Backend Development  >  PHP mysql_data_seek() function tutorial_PHP tutorial

PHP mysql_data_seek() function tutorial_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:03:59971browse

PHP mysql_data_seek() function tutorial

Definition and usage
The mysql_data_seek() function moves the internal row pointer.

The contiguous internal pointer is currently queued as returned by the mysql_query() function.

This function returns TRUE on success, or FALSE on failure.

Grammar

mysql_data_seek(data,row)
参数
data: 从mysql_query数据库查询
rows:查出多少行.
现在我们来看个mysql_data_seek的实例吧.
<?
<pre class="brush:php;toolbar:false">$sql = "SELECT * from Person";
$result = mysql_query($sql,$con);
print_r(mysql_fetch_row($result));
mysql_data_seek($result,3);
print_r(mysql_fetch_row($result));
 
?>
 
输出的结果.
 
<pre class="brush:php;toolbar:false">Array
(
[0] => Refsnes
[1] => Kai Jim
[2] => Taugata
)
Array
(
[0] => Refsnes
[1] => Ståle
[2] => Sandnes
)

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630899.htmlTechArticlePHP mysql_data_seek() Function Tutorial Definition and Usage The mysql_data_seek() function moves the internal row pointer. The contiguous internal pointer is currently ranked in the returned result of the mysql_query() function...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn