pg_fetch_all

(PHP 4 >= 4.3.0)

pg_fetch_all -- Fetch a row as an array

Description

array pg_fetch_all ( resource result [, int row])

pg_fetch_all() returns an array that contains all row (tuples/records) in result resource. It returns FALSE, if there are no more rows.

See also pg_fetch_row(), pg_fetch_array(), pg_fetch_object() and pg_fetch_result().

Example 1. PostgreSQL fetch array

<?php 
$conn = pg_pconnect ("dbname=publisher");
if (!$conn) {
    echo "An error occured.\n";
    exit;
}

$result = pg_query ($conn, "SELECT * FROM authors");
if (!$result) {
    echo "An error occured.\n";
    exit;
}

$arr = pg_fetch_all ($result, 0, PGSQL_NUM);

var_dump($arr);

?>