Summary: Set internal row offset in result resource
PHP 5Related methods: pg_fetch_array, pg_fetch_assoc, pg_fetch_object, pg_fetch_result, pg_fetch_row
bool pg_result_seek(resource $result, int $offset)
pg_result_seek() sets the internal row offset in a result resource.
TRUE on success or
FALSE on failure.
- resource $result: PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).
- int $offset: Row to move the internal offset to in the
resultresource. Rows are numbered starting from zero.
Example #1 pg_result_seek() example
// 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)
// Fetch the 3rd row
$row = pg_fetch_row($result);