oci_parse works on cl but not on web
Posted: Sat Feb 03, 2007 12:43 pm
Using apache2triad edge build. PHP 5. Windows. Code works from the command line but if I try it from a browser it takes forever then finally I get a window that says "Page cannot be displayed". I have removed code until it worked in the browser. Logging into oracle and echoing "successfully loged into the database" works. Echoing lines to show where I am in the code works. However as soon as I add oci_parse, running the code on apache goes out to lunch. On the command line the whole program works and logs into the db and gives me output. Here is the code:
What am I doing wrong? I have tried many many snippets from oracle and php.net and they ALL fail on the same thing. I must be missing something fundamental here.
thanks
brad
Code: Select all
<html>
<body>
<?php
if ($conn=OCILogon("user", "password", "db")) {
echo "Successfully connected to Oracle.\n";
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err[text];
}
$query = "select count(Tally), sum (Tally) from reporter_status where BU_6 = 'OBM_IHUB' and FirstOccurrence > sysdate - 1";
$statement = oci_parse($conn, $query);
oci_execute ($statement);
echo "Before While.\n";
while ($row = oci_fetch_array ($statement, OCI_BOTH)) {
echo "$row[0].\n";
echo "$row[1].\n";
}
OCILogoff($conn);
?>
</body>
</hmtl>thanks
brad