Oracle 8
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 OCICancel ocisetprefetch OCIWriteLobToFile OCISaveLobFile OCISaveLob OCILoadLob OCIColumnScale OCIColumnPrecision OCIColumnTypeRaw OCINewCollection OCIFreeCollection OCICollAssign OCICollAssignElem OCICollGetElem OCICollMax OCICollSize OCICollTrim
Description
int ocifetchstatement(resource stmt ,array & variable )
ocifetchstatement retourne toutes les lignes d'un résultat dans le tableau variable. ocifetchstatement retourne le nombre de lignes retournées.
<?php/* exemple ociFetchStatement par 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 "Rien n'a été trouvé<br>\n";}print "$nrows Records Selected<br>\n";ociFreeStatement($stmt);ociLogoff($conn);?>