downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

pg_field_prtlen> <pg_field_name
Last updated: Fri, 20 Nov 2009

view this page in

pg_field_num

(PHP 4 >= 4.2.0, PHP 5)

pg_field_numZwraza numer kolumny o podanej nazwie

Opis

int pg_field_num ( resource $wynik , string $nazwa_pola )

pg_field_num() zwraca indeks numeru pola o podanej nazwie nazwa_pola w podanym identyfikatorze wyniku wynik .

Informacja: Ta funkcja była poprzednio nazwana pg_fieldnum().

Parametry

wynik

Identyfikator wyniku zapytania PostgreSQL-a, zwrócony przez pg_query(), pg_query_params() lub pg_execute() (między innymi).

nazwa_pola

Nazwa kolumny.

Zwracane wartości

Numer pola (numerowanie od zera), lub -1 w razie błędu.

Przykłady

Przykład #1 Pobieranie informacji o polach

<?php
  $polaczenie 
pg_connect("dbname=wydawca") or die("Nie można się połączyć");

  
$wyn pg_query($polaczenie"select autor, rok, tytul from autorzy where autor = 'Orwell'");
  
  echo 
"Kolumna 'tytul' to pole numer: "pg_field_num($wyn'tytul');
?>

Powyższy przykład wyświetli:

Kolumna 'tytul' to pole numer: 2

Zobacz też:



add a note add a note User Contributed Notes
pg_field_num
There are no user contributed notes for this page.

pg_field_prtlen> <pg_field_name
Last updated: Fri, 20 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites