$myeid is ' . $myeid . '';
print '';
while ($row = oci_fetch_array($s, OCI_RETURN_NULLS+OCI_ASSOC)) {
print '';
foreach ($row as $item) {
print '| '.($item?htmlentities($item):' ').' | ';
}
print ' ';
}
print ' ';
}
// Create connection to Oracle
$c = oci_connect("hr", "hrpwd", "//localhost/orcl");
// Use bind variable to improve resuability, and to
// remove SQL Injection attacks.
$query = 'select * from employees where employee_id = :eidbv';
$s = oci_parse($c, $query);
$myeid = 101;
oci_bind_by_name($s, ":EIDBV", $myeid);
oci_execute($s);
do_fetch($myeid, $s);
// Redo query without reparsing SQL statement
$myeid = 104;
oci_execute($s);
do_fetch($myeid, $s);
// Close the Oracle connection
oci_close($c);
?>
|