pg_fetch_all(3) php man page | unix.com

Man Page: pg_fetch_all

Operating Environment: php

Section: 3

PG_FETCH_ALL(3) 														   PG_FETCH_ALL(3)

pg_fetch_all - Fetches all rows from a result as an array

SYNOPSIS
array pg_fetch_all (resource $result)
DESCRIPTION
pg_fetch_all(3) returns an array that contains all rows (records) in the result resource. Note This function sets NULL fields to the PHP NULL value.
PARAMETERS
o $result - PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others).
RETURN VALUES
An array with all rows in the result. Each row is an array of field values indexed by field name. FALSE is returned if there are no rows in the result, or on any other error.
EXAMPLES
Example #1 PostgreSQL fetch all <?php $conn = pg_pconnect("dbname=publisher"); if (!$conn) { echo "An error occurred. "; exit; } $result = pg_query($conn, "SELECT * FROM authors"); if (!$result) { echo "An error occurred. "; exit; } $arr = pg_fetch_all($result); print_r($arr); ?> The above example will output something similar to: Array ( [0] => Array ( [id] => 1 [name] => Fred ) [1] => Array ( [id] => 2 [name] => Bob ) )
SEE ALSO
pg_fetch_row(3), pg_fetch_array(3), pg_fetch_object(3), pg_fetch_result(3). PHP Documentation Group PG_FETCH_ALL(3)
Related Man Pages
pg_fetch_all(3) - php
pg_field_is_null(3) - php
pg_num_rows(3) - php
pg_query(3) - php
pg_result_seek(3) - php
Similar Topics in the Unix Linux Community
how to return an array of elements from oracle to shell script
Reading Of Array Element in Unix
array error
Array and field separator
Arrays in awk