pg_result_seek
pg_result_seek
(PHP 4 >= 4.3.0, PHP 5, PHP 7)
pg_result_seek - 在结果资源中设置内部行偏移量
描述
bool pg_result_seek ( resource $result , int $offset )
pg_result_seek()
在结果资源中设置内部行偏移量。
参数
result
PostgreSQL查询结果资源,由pg_query(),pg_query_params()或pg_execute()等返回。
offset
行将内部偏移量移动到result
资源中。行从零开始编号。
返回值
成功返回TRUE
或失败时返回FALSE
。
例子
示例#1 pg_result_seek()示例
<?php
// Connect to the database
$conn = pg_pconnect("dbname=publisher"
// Execute a query
$result = pg_query($conn, "SELECT author, email FROM authors"
// Seek to the 3rd row (assuming there are 3 rows)
pg_result_seek($result, 2
// Fetch the 3rd row
$row = pg_fetch_row($result
?>