PG_FETCH_ALL(3) PG_FETCH_ALL(3) pg_fetch_all - Fetches all rows from a result as an arraySYNOPSISarray pg_fetch_all (resource $result)DESCRIPTIONpg_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.PARAMETERSo $result - PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others).RETURN VALUESAn 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.EXAMPLESExample #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 ALSOpg_fetch_row(3), pg_fetch_array(3), pg_fetch_object(3), pg_fetch_result(3). PHP Documentation Group PG_FETCH_ALL(3)