Home > PHP > Function > PostgreSQL > pg_fetch_all()

pg_fetch_all()

pg_fetch_all - Fetches all rows from a result as an array

Syntax

array pg_fetch_all (resource $result)

Arguments

  • result - PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).

Description

pg_fetch_all() returns an array that contains all rows (records) in the result resource.

Version

PHP 4.3.0, 5

Return value

An array with all rows in the result. Each row is an array of field values indexed by field name.