<html>
<title>Demo:  <?php echo $PHP_SELF; ?></title>
<body bgcolor="white">
<h1> <?php echo $PHP_SELF; ?></h1>
<hr>
<!-- Demo begin -->
<?php
 
// Connect to Oracle using SID= $ORACLE_SID og $TWO_TASKS
 $con = OCILogon( "scott", "tiger");

 
// Get users tables
 $sql =  "select ename,dname from emp, dept ";
 $sql .=  "where emp.deptno=dept.deptno order by dname";
 echo  "SQL: ".$sql;
 echo  "<p>\n";

 $stmt = OCIParse($con, $sql);
 OCIExecute($stmt);

 while (OCIFetchInto($stmt, &$result, OCI_ASSOC)) {
   echo $result[ 'ENAME'];
   echo  " - ";
   echo $result[ 'DNAME'];
   echo  "<br>\n";
 }

 
// Disconnect from Oracle
 OCILogoff($con);
?>
<!-- Demo end -->
<hr>
<i>by Hans Schou <a href="mailto:chlor@schou.dk">&lt;chlor@schou.dk&gt;</a></i>
<a href="http://www.schou.dk">http://www.schou.dk</a>
<br>
<?php
 
// Display source file if exists
 if (file_exists($fn = basename($PHP_SELF. "s")))
   echo  "<i>Source file: <a href=\"".$fn. "\">$fn</a></i>\n";
 else
   echo  "<i>Source file $fn is not available</i>\n";
?>
</body>
</html>