$aa = $db->prepare('select * from user',array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL)); $aa ->execute(); $aa->fetch(); $aa->fetch(); $a=$aa->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT); print_r($a);
当然是第三行记录啦,你仔细看看手册上的例子以及函数的说明
FETCH_ORI_NEXT
Fetch the next row in the result set. Valid only for scrollable cursors.
取下一行的结果集
FETCH_ORI_PRIOR
Fetch the previous row in the result set. Valid only for scrollable cursors.
取前一行的结果集
FETCH_ORI_FIRST (integer)
Fetch the first row in the result set. Valid only for scrollable cursors.
取结果集中的第一行
FETCH_ORI_LAST
Fetch the last row in the result set. Valid only for scrollable cursors.
取最后一行的结果集
FETCH_ORI_ABS
Fetch the requested row by row number from the result set. Valid only for scrollable cursors.
获取所请求的行数从结果集
FETCH_ORI_REL
Fetch the requested row by relative position from the current position of the cursor in the result set. Valid only for scrollable cursors.
获取所请求的行从结果中光标当前位置的相对位置的设置
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号