pg_fetch_assocPodręcznik PHPPoprzedniNastępnypg_fetch_assoc (PHP 4 >= 4.3.0)pg_fetch_assoc -- Fetch a row as an arrayDescriptionarray pg_fetch_assoc ( resource result [, int row])
pg_fetch_assoc() returns an associative array that
corresponds to the fetched row (tuples/records). It returns
FALSE, if there are no more rows.
pg_fetch_assoc() is an extended version of
pg_fetch_row(). In addition to storing the
data in the numeric indices (field index) to the result array, it
also stores the data in associative indices (field name) by
default.
row is row (record) number to be
retrieved. First row is 0.
pg_fetch_assoc() is NOT significantly
slower than using pg_fetch_row(), while it
provides a significant ease of use.
See also pg_fetch_row(),
pg_fetch_array(),
pg_fetch_assoc(),
pg_fetch_object() and
pg_fetch_result().
Przykład 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_assoc ($result, 1, PGSQL_ASSOC);
echo $arr["author"] . " <- array\n";
?>
PoprzedniSpis treściNastępnypg_fetch_arrayPoczątek rozdziałupg_fetch_object
Wyszukiwarka
Podobne podstrony:
function pg fetch objectfunction pg fetch arrayfunction pg fetch rowfunction mysql fetch assocfunction pg fetch objectfunction pg fetch allfunction pg fetch rowfunction pg fetch objectfunction pg fetch resultfunction mssql fetch assocfunction pg fetch arrayfunction mssql fetch assocfunction pg fetch arrayfunction pg fetch rowwiÄcej podobnych podstron