Manuál PHP | ||
---|---|---|
PÅ™edcházejÃcà | DalÅ¡Ã |
pg_fetch_array
Popis
array pg_fetch_array ( resource result [, int row [, int result_type]] )pg_fetch_array() returns an array that corresponds to the fetched row (record).
pg_fetch_array() is an extended version of pg_fetch_row(). In addition to storing the data in the numeric indices (field number) to the result array, it can also store the data using associative indices (field name). It stores both indicies by default.
Poznámka: Tato funkce nastavuje pole s hodnotou NULL na hodnotu PHP NULL.
pg_fetch_array() is NOT significantly slower than using pg_fetch_row(), and is significantly easier to use.
Poznámka:
row
became optional in PHP 4.1.0.
Poznámka:
result_type
was added in PHP 4.0.0.
Seznam parametrů
result
PostgreSQL query result resource, returned by pg_query(), pg_query_params() or pg_execute() (among others).
row
Row number in result to fetch. Rows are numbered from 0 upwards. If omitted, next row is fetched.
result_type
An optional parameter that controls how the returned array is indexed.
result_type
is a constant and can take the following values: PGSQL_ASSOC, PGSQL_NUM and PGSQL_BOTH. Using PGSQL_NUM, pg_fetch_array() will return an array with numerical indices, using PGSQL_ASSOC it will return only associative indices while PGSQL_BOTH, the default, will return both numerical and associative indices.
Návratové hodnoty
An array indexed numerically (beginning with 0) or associatively (indexed by field name), or both. Each value in the array is represented as a string. Database NULL values are returned as NULL.
FALSE is returned if row
exceeds the number
of rows in the set, there are no more rows, or on any other error.
PÅ™Ãklady
PÅ™edcházejÃcà | Domů | DalÅ¡Ã |
pg_fetch_all | Nahoru |