Home  >  Article  >  php教程  >  PHP mysql_data_seek() 函数教程

PHP mysql_data_seek() 函数教程

WBOY
WBOYOriginal
2016-06-13 10:07:23948browse

PHP mysql_data_seek() 函数教程

定义和用法
该mysql_data_seek ( )函数移动内部行指针。

连续的内部指针是目前排在返回结果的mysql_query ( )函数。

此函数返回TRUE成功,或FALSE的失败。

语法

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
)
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
Previous article:php flock 函数Next article:php如何显示mysql数据库记录