pg_result_seek
PHP function
Edit on GitHub ✎
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
Set internal row offset in result instance
Description
pg_result_seek(PgSql\Result $result, int $row): bool
pg_result_seek() sets the internal row offset in the result instance.
Parameters
resultResult
rowRow to move the internal offset to in the
PgSql\Resultinstance. Rows are numbered starting from zero.
Return Values
Success
Changelog
| Version | Description |
|---|
Examples
pg_result_seek() example
php
<?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);
?>