php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1800 Problem with Oracle Cursors
Submitted: 1999-07-21 10:14 UTC Modified: 1999-09-22 05:48 UTC
From: hjensen at email dot com Assigned:
Status: Closed Package: Oracle related
PHP Version: 4.0 Beta 1 OS: RedHat Linux 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 + 49 = ?
Subscribe to this entry?

 
 [1999-07-21 10:14 UTC] hjensen at email dot com
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";
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-22 05:48 UTC] thies at cvs dot php dot net
please check with latest CVS - resumbmit if it's still there!


 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 27 04:03:38 2021 UTC