OCI_OBJECT1.htm
Objective :
  • Number of Rows using : oci__num_rows($stmt)  and
     PDO::rowcount $count = $stmt->rowCount() .
    PDO::rowCount did not work with Oracle 11.2 / in  windows/IIS/FastCGI-PHP
  • Please review oci_pdo_empT1.htm and oci_pdo_empT2.htm

 

Pre-Created

SCRIPT:

<?php
echo "Example OCI_FETCH_ARRAY ..OCI_OBJECT <br/>";
$sql = "select empno, ename from emp WHERE rownum <=6";
$conn = oci_connect('scott', 'Son', 'localhost/orcl.gateway.2wire.net');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
//echo" DB connected: querying a table <br/>";
}
$stmt = oci_parse($conn, $sql);
oci_execute($stmt);
//
while ($row = oci_fetch_object($stmt)) {
echo $row->EMPNO . " ".$row->ENAME ." <br/>";
}
//
echo " no of rows : ". oci_num_rows($stmt);
oci_free_statement($stmt);
oci_close($conn);
echo "<br/> Oracle db conection closed";
//
?>

DISPLAY