PHP4 Bug #1800: Problem with Oracle Cursors

From: Date: Wed, 21 Jul 1999 14:14:56 +0000
Subject: PHP4 Bug #1800: Problem with Oracle Cursors
Groups: php.dev 
Request: Send a blank email to php-dev+get-8894@lists.php.net to get a copy of this message
From: hjensen@email.com Operating system: RedHat Linux 5 PHP version: 4.0 Beta 1 PHP Bug Type: Oracle related Bug description: Problem with Oracle Cursors I have compiled PHP4B1 into Apache 1.3.6 as follows: ./configure --with-apache=... --with-oracle=$ORACLE_HOME ... All of my PHP pages but the ones using the Oracle functions work, so I will assume that PHP/Apache have been compiled and configured correctly. Here is a sample script that does not work: <? $dbc=ora_plogon("myuid","mypwd"); $cur=ora_open($dbc); ora_parse($cur,"select count(*) from my_users"); ora_exec($cur); ora_fetch($cur); echo "there are ".ora_getcolumn($cur,0)." users in the system"; ?> The error messages are all related to $cur being invalid Warning: Invalid cursor index 1 in /mnt/diskc/html/test.phtml on line 4 The workaround I have found is to open a dummy cursor before opening the cursor that I end up using further down the script. The following script works: <? $dbc=ora_plogon("myuid","mypwd"); $dummy=ora_open($dbc); $cur=ora_open($dbc); ora_parse($cur,"select count(*) from my_users"); ora_exec($cur); ora_fetch($cur); echo "there are ".ora_getcolumn($cur,0)." users in the system"; ?>

« previous php.dev (#8894) next »