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

search for in the

ibase_free_event_handler> <ibase_fetch_row
Last updated: Fri, 10 Oct 2008

view this page in

ibase_field_info

(PHP 4, PHP 5)

ibase_field_infoZwraca informację o polu

Opis

array ibase_field_info ( resource $wynik , int $numer_pola )

Zwraca tablicę zawierającą informacje o polu, po wykonaniu zapytania SELECT.

Parametry

wynik

Identyfikator wyniku.

numer_pola

Numer pola.

Zwracane wartości

Zwraca tablicę z następującymi kluczami: name, alias, relation, length, type - odpowiednio: nazwa, alias, relacja, długość i typ.

Przykłady

Example #1 Przykład ibase_field_info()

<?php
$rs 
ibase_query("SELECT * FROM tabela");
$coln ibase_num_fields($rs);
for (
$i 0$i $coln$i++) {
    
$col_info ibase_field_info($rs$i);
    echo 
"nazwa: "$col_info['name']. "\n";
    echo 
"alias: "$col_info['alias']. "\n";
    echo 
"relacja: "$col_info['relation']. "\n";
    echo 
"długość: "$col_info['length']. "\n";
    echo 
"typ: "$col_info['type']. "\n";
}
?>

Zobacz też:



add a note add a note User Contributed Notes
ibase_field_info
tiago at econtabil dot com
07-Apr-2006 01:40
Example:
$db = ibase_connect($host,$username,$password, "None", 0, 3 ) or die ('Error trying connect to Database!');

$select = "SELECT * from TABLE";   
$sql = ibase_query($db,$select) or die($select);

$total_fields= ibase_num_fields($sql);

for ($j = 1; $j <= $total_fields; $j++)
  {
    $info_field = ibase_field_info($sql, $j-1 );
    print("Name: " . $info_campo[1]); // print the field name
    print("Type:". $info_campo[4]); //print the field type
    print("Size: " . $info_campo[3]); // print the field size
  }
This function does not return the type from the fields as we are accustomed in interbase.
Example: Fields VARCHAR are returns as VARYING. Fields of the type CHAR return TEXT.

Tested in Firebird 1.5 Super Server.

ibase_free_event_handler> <ibase_fetch_row
Last updated: Fri, 10 Oct 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites