描述
int 
ocifetchstatement ( resource stmt, array &output [, int skip [, int maxrows [, int flags]]])
     ocifetchstatement() 从一个结果中获取所有的行到一个
用户定义的数组。
     ocifetchstatement() 返回获取的行数。
 skip 是从结果中获取数据时,最开始忽略的行数
(该参数的默认值是 0,即从第一行开始)。
maxrows 是读取的行数,从第 skip 行开始
(默认值是 -1,即所有行)。
    
     flags 表示存在的选项,
可以是下列任一的组合:
     
| 
       OCI_FETCHSTATEMENT_BY_ROW
       | 
| 
       OCI_FETCHSTATEMENT_BY_COLUMN (默认值)
       | 
| 
       OCI_NUM
       | 
| 
       OCI_ASSOC
       | 
    
     
例子 1. ocifetchstatement() 
<?php /* OCIFetchStatement example mbritton at verinet dot com (990624) */
  $conn = OCILogon("scott", "tiger");
  $stmt = OCIParse($conn, "select * from emp");
  OCIExecute($stmt);
  $nrows = OCIFetchStatement($stmt, $results); if ($nrows > 0) {    echo "<table border=\"1\">\n";    echo "<tr>\n";    while (list($key, $val) = each($results)) {       echo "<th>$key</th>\n";    }    echo "</tr>\n";        for ($i = 0; $i < $nrows; $i++) {       reset($results);       echo "<tr>\n";       while ($column = each($results)) {             $data = $column['value'];          echo "<td>$data[$i]</td>\n";       }       echo "</tr>\n";    }    echo "</table>\n"; } else {    echo "No data found<br />\n"; }       echo "$nrows Records Selected<br />\n";   OCIFreeStatement($stmt); OCILogoff($conn); ?>
 |  
  |