I. Na początek
II.Instalacja i konfiguracja
III. Opis języka
IV. Bezpieczeństwo
V. Możliwości
VI. Opis funkcji
VII. Zend API
VIII. PHP API: Interfejs rozszerzeń
X. Dodatki

Manual PHP

Zapraszam do korzystania z zamieszczonego przeze mnie manuala php. Mam nadzieję, że ta jego kopia przyda się zarówno profesjonalnym programistą, jak i początkującym twórcą skryptów PHP.

Autorzy

Mehdi Achour,
Friedhelm Betz,
Antony Dovgal,
Nuno Lopes,
Philip Olson,
Georg Richter,
Damien Seguy,
Jakub Vrana,
I kilka innych

Redakcja:

Gabor Hojtsy,
Marcin Dąbrowski, Michał Grzechowiak, Leszek Krupiński, Adam Major, Paweł Paprota, Michał Pena, Sławomir Pucia, Jarek Tabor, Tomasz Wójtowicz,

pg_fetch_assoc

(PHP 4 >= 4.3.0, PHP 5)

pg_fetch_assoc -- Fetch a row as an associative array

Opis

array 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 equivalent to calling pg_fetch_array() with PGSQL_ASSOC for the optional third parameter. It only returns an associative array. If you need the numeric indices, use pg_fetch_row().

Notatka: This function sets NULL fields to PHP NULL value.

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.

Notatka: From 4.1.0, row became optional. Calling pg_fetch_assoc() will increment the internal row counter by one.

Przykłady

Przykład 1. pg_fetch_assoc() example

<?php
$conn
= pg_connect("dbname=publisher");
if (!
$conn) {
  echo
"An error occured.\n";
  exit;
}

$result = pg_query($conn, "SELECT id, author, email FROM authors");
if (!
$result) {
  echo
"An error occured.\n";
  exit;
}

while (
$row = pg_fetch_assoc($result)) {
  echo
$row['id'];
  echo
$row['author'];
  echo
$row['email'];
}
?>


print 'allianz direct 1171501659' . "\n"; print 'toczenie cnc 1171501885' . "\n"; print 'Niewydolność nerek 1171501756' . "\n"; print 'autocasco 1171501657' . "\n"; print 'Imprezy motocyklowe 1171501800' . "\n";