Query: pg_fetch_result
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PG_FETCH_RESULT(3) PG_FETCH_RESULT(3) pg_fetch_result - Returns values from a result resourceSYNOPSISstring pg_fetch_result (resource $result, int $row, mixed $field)DESCRIPTIONstring pg_fetch_result (resource $result, mixed $field) pg_fetch_result(3) returns the value of a particular row and field (column) in a PostgreSQL result resource. Note This function used to be called pg_result(3).PARAMETERSo $result - PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others). o $row - Row number in result to fetch. Rows are numbered from 0 upwards. If omitted, next row is fetched. o $field - A string representing the name of the field (column) to fetch, otherwise an int representing the field number to fetch. Fields are numbered from 0 upwards.RETURN VALUESBoolean is returned as "t" or "f". All other types, including arrays are returned as strings formatted in the same default PostgreSQL man- ner that you would see in the psql program. Database NULL values are returned as NULL. FALSE is returned if $row exceeds the number of rows in the set, or on any other error.EXAMPLESExample #1 pg_fetch_result(3) example <?php $db = pg_connect("dbname=users user=me") || die(); $res = pg_query($db, "SELECT 1 UNION ALL SELECT 2"); $val = pg_fetch_result($res, 1, 0); echo "First field in the second row is: ", $val, " "; ?> The above example will output: First field in the second row is: 2SEE ALSOpg_query(3), pg_fetch_array(3). PHP Documentation Group PG_FETCH_RESULT(3)
Related Man Pages |
---|
pdostatement.fetchcolumn(3) - php |
fbsql_fetch_array(3) - php |
ifx_fetch_row(3) - php |
mssql_result(3) - php |
pg_fetch_array(3) - php |
Similar Topics in the Unix Linux Community |
---|
how to scan a sequential file to fetch some of the records? |
sort and semi-duplicate row - keep latest only |
Row number |
Replace values |
Extract row grater than 3 from previous value of a field |