<?php
echo "oci_bind_by_name funciton : single variable <br/>";
//
$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);
}
$stmt = oci_parse($conn, "select * from emp where ENAME = :empname");
//
$ename ="SMITH";
oci_bind_by_name($stmt, ":empname", $ename);
oci_execute($stmt);
//
$row = oci_fetch_array($stmt, OCI_ASSOC);
echo "<table border='1'><tr><td>";
echo "ename is: ". $row['ENAME'] ."</td><td>";
echo "EMPNO is: ". $row['EMPNO'] ."</td><td>";
echo "JOB is: ". $row['JOB'] ."</td><td>";
//
echo "</tr></table>\n";
oci_free_statement($stmt);
oci_close($conn);
echo "<br/> Oracle db conection closed";
//
?>