<?php
/* oci_define_by_name example - thies at thieso dot net (980219) */
$conn = oci_connect("scott", "tiger");
$stmt = oci_parse($conn, "SELECT empno, ename FROM emp");
/* the define MUST be done BEFORE oci_execute! */
oci_define_by_name($stmt, "EMPNO", $empno);
oci_define_by_name($stmt, "ENAME", $ename);
oci_execute($stmt);
while (oci_fetch($stmt)) {
echo "empno:" . $empno . "\n";
echo "ename:" . $ename . "\n";
}
oci_free_statement($stmt);
oci_close($conn);
?>