|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-20 10:01 UTC] sangelillis at abacosystem dot it
Hello,
we have a PHP script that run in a infinite loop looking
on ORACLE DB (8.1.7). In each loop a SELECT is done, if this doesn't return data then the SELECT is executed after two seconds. If after not certain time the SELECT doesn't return data then when it returns data the process is killed after OCIFetch(), view code for understand better.
//START
$dbConnection = @OCILogon(USER_ID, PASSWORD, SID);
// infinite loop
$error=0;
do
{
$query="SELECT DATA FROM PROV";
$stmt = @OCIParse($dbConnection,$query);
@OCIDefineByName($stmt,"DATA",&$data);
@OCIExecute($stmt);
$err_ora = @OCIError($stmt);
if ($err_ora)
{
$error=1;
}
While (@OCIFetch($stmt) && ($error==0))
{
....
....
}
@OCIFreeStatement($stmt);
sleep(2);
}while ($error==0);
Thanks for any suggestion
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 06:00:02 2025 UTC |
Can you please try without these @ signs? If you don't like the errors/warnings being displayed on your webpages, you can turn display_errors off and log_errors on, so you can find the errors/warnings in your log file. ini_set('display_errors','0'); ini_set('log_errors','1');I have tried without @ but the visualization of any errors is not had, the process falls without leaving anybody trace. The following version of the script is more complete: <?php set_time_limit(0); ini_set('display_errors','0'); ini_set('log_errors','1'); //START $dbConnection = @OCILogon(USER_ID, PASSWORD, SID); // infinite loop $error=0; do { $query="SELECT DATA FROM PROV"; $stmt = @OCIParse($dbConnection,$query); OCIDefineByName($stmt,"DATA",&$data); OCIExecute($stmt); $err_ora = OCIError($stmt); if ($err_ora) { $error=1; } While (OCIFetch($stmt) && ($error==0)) { .... .... } OCIFreeStatement($stmt); sleep(2); }while ($error==0); OCILogoff($dbConnection); ?> Thank for any suggestion