Home > php教程 > php手册 > PHP mysql_data_seek() 函数教程

PHP mysql_data_seek() 函数教程

WBOY
Release: 2016-06-13 10:07:23
Original
979 people have browsed it

PHP mysql_data_seek() 函数教程

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

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

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

语法

mysql_data_seek(data,row)
Copy after login
参数
Copy after login
data: 从mysql_query数据库查询
Copy after login
rows:查出多少行.
Copy after login
现在我们来看个mysql_data_seek的实例吧.
Copy after login
Copy after login
<pre class="brush:php;toolbar:false">$sql = "SELECT * from Person";
$result = mysql_query($sql,$con);
print_r(mysql_fetch_row($result));
Copy after login
mysql_data_seek($result,3);
print_r(mysql_fetch_row($result));
Copy after login
 
Copy after login
Copy after login
Copy after login
?>
Copy after login
 
Copy after login
Copy after login
Copy after login
输出的结果.
Copy after login
 
Copy after login
Copy after login
Copy after login
<pre class="brush:php;toolbar:false">Array
(
[0] => Refsnes
[1] => Kai Jim
[2] => Taugata
)
Copy after login
Array
(
[0] => Refsnes
[1] => Ståle
[2] => Sandnes
)
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template