ibase_num_fields

(PHP3 >= 3.0.7, PHP4 >= 4.0RC1)

ibase_num_fields --  Get the number of fields in a result set

Description

int ibase_num_fields (int result_id)

Returns an integer containing the number of fields in a result set.

  1 
  2 <?php
  3     $dbh = ibase_connect ($host, $username, $password);
  4     $stmt = 'SELECT * FROM tblname';
  5     $sth = ibase_query ($dbh, $stmt);
  6 
  7     if (ibase_num_fields($sth) > 0) {
  8         while ($row = ibase_fetch_object ($sth)) {
  9             print $row->email . "\n";
 10         }
 11     } else {
 12         die ("No Results were found for your query");
 13     }
 14 
 15     ibase_close ($dbh);
 16 ?>
 17       

See also: ibase_field_info().

Megjegyzés: Ibase_num_fields() is currently not functional in PHP4.