I am having a problem with PHP 5.0.1, compiled with OCI8. When I execute a query script the first time, everything works fine; however, on subsequent executions of the script, I receive the following errors:
Warning: ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-24324: service handle not initialized in testsql.php on line 22
Warning: ocifetch() [function.ocifetch]: OCIFetch: ORA-24338: statement handle not executed in testsql.php on line 25
Here is part of my code:
<?
$db = "DATABASE";
$username = "USERNAME";
$password = "PASSWORD";
$connect = OCILogon($username, $password, $db);
$query_string = "SELECT FIELD_NAME FROM TABLE";
$query = OCIParse($connect,$query_string);
OCIExecute($query);
while (OCIFetch($query)){
echo OCIResult($query, "FIELD_NAME") . "<br>\n";
}
OCIFreeStatement($query);
OCI_Close($connect);
?>
Line numbers are different as I have not posted all of my code; however, there is only one OCIExecute and one OCIFetch, so you should be able to see what is causing the issue from the code above.
I am using Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production running on Solaris 8.