首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

pg_result_seek

(PHP 4 >= 4.3.0, PHP 5, PHP 7)

pg_result_seek - 在结果资源中设置内部行偏移量

描述

代码语言:javascript
复制
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()示例

代码语言:javascript
复制
<?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);
 
?>

扫码关注腾讯云开发者

领取腾讯云代金券