★ wanayoo — archive 1999 http://fr.php.net/manual/function.ocifetchstatement.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to OCI8
Quick Reference
English version of this pageGerman version of this pageJapanese version of this page
Italian version of this pageFrench version of this pageHungarian version of this page
Spanish version of this pageDutch version of this pageBrazilian Portuguese version of this page
Korean version of this pageCzech version of this page
OCI8
* OCIDefineByName
* OCIBindByName
* OCILogon
* OCIPLogon
* OCINLogon
* OCILogOff
* OCIExecute
* OCICommit
* OCIRollback
* OCINewDescriptor
* OCIRowCount
* OCINumCols
* OCIResult
* OCIFetch
* OCIFetchInto
* OCIFetchStatement
* OCIColumnIsNULL
* OCIColumnName
* OCIColumnSize
* OCIColumnType
* OCIServerVersion
* OCIStatementType
* OCINewCursor
* OCIFreeStatement
* OCIFreeCursor
* OCIFreeDesc
* OCIParse
* OCIError
* OCIInternalDebug

  Thanks to:
 Chek.com
 easyDNS
 VA Linux Systems

  Related sites:
Apache
MySQL
PostgreSQL
Zend Tech.

  Community:
LinuxFund.org
OSDN
Manual: OCIFetchStatement
View the source code for this pageSearch the site



Previous page
 OCIFetchInto
 Updated
Mon, 08 Jan 2001
OCIColumnIsNULL 
Next page


OCIFetchStatement

(PHP 3>= 3.0.8, PHP 4 )

OCIFetchStatement -- Fetch all rows of result data into an array.

Description

int OCIFetchStatement (int stmt, array &variable)

OCIFetchStatement() fetches all the rows from a result into a user-defined array. OCIFetchStatement() returns the number of rows fetched.

Example 1. OCIFetchStatement


<?php
/* OCIFetchStatement example mbritton@verinet.com (990624) */

$conn = OCILogon("scott","tiger");

$stmt = OCIParse($conn,"select * from emp");

OCIExecute($stmt);

$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 ) {
   print "<TABLE BORDER=\"1\">\n";
   print "<TR>\n";
   while ( list( $key, $val ) = each( $results ) ) {
      print "<TH>$key</TH>\n";
   }
   print "</TR>\n";
   
   for ( $i = 0; $i < $nrows; $i++ ) {
      reset($results);
      print "<TR>\n";
      while ( $column = each($results) ) {   
         $data = $column['value'];
         print "<TD>$data[$i]</TD>\n";
      }
      print "</TR>\n";
   }
   print "</TABLE>\n";
} else {
   echo "No data found<BR>\n";
}      
print "$nrows Records Selected<BR>\n";
 
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
     

 About Notes


Previous page
 OCIFetchInto
 Updated
Mon, 08 Jan 2001
OCIColumnIsNULL 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
France
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.