PHP 4.0 Bug #5888: Can't access result columns meta information after reaching the end of result.

From: Date: Tue, 01 Aug 2000 04:10:12 +0000
Subject: PHP 4.0 Bug #5888: Can't access result columns meta information after reaching the end of result.
Groups: php.dev 
Request: Send a blank email to php-dev+get-27170@lists.php.net to get a copy of this message
From: mlemos@acm.org Operating system: Linux RH 6 PHP version: 4.0 Latest CVS (01/08/2000) PHP Bug Type: Oracle related Bug description: Can't access result columns meta information after reaching the end of result. Try the following script and see that after attempting to fetch the row after the last in the result set, OCINumCols() no longer returns the right value. This problem did not exist in PHP 4.0.0 . Also notice the erroneous warning that is outputted. <br> <b>Warning</b>: failed to rollback outstanding transactions!: ORA-24324: servic e handle not initialized in <b>Unknown</b> on line <b>0</b><br> <? if(!function_exists("OCINLogon")) { $this->last_error="Oracle OCI API support is not available in this PHP configuration"; return(0); } putenv("ORACLE_HOME=/home/oracle/u01"); putenv("ORACLE_SID=dboracle"); if(($connection=OCINLogon("SYS","change_on_install","dboracle"))) { if(($cursor=OCINewCursor($connection))) { if(($statement=OCIParse($connection,"SELECT * FROM DUAL"))) { if(($result=OCIExecute($statement,OCI_COMMIT_ON_SUCCESS))) { echo OCINumCols($statement),"\n"; OCIFetch($statement); OCIFetch($statement); echo OCINumCols($statement),"\n"; OCIFreeCursor($statement); } else echo "Could not execute query\n"; } else echo "Could not parse query\n"; OCIFreeCursor($cursor); } else echo "Could not create new query cursor\n"; OCILogOff($connection); } else echo "Could not connect to Oracle server\n"; ?>

« previous php.dev (#27170) next »