|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-01-20 20:55 UTC] danielc@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 05:00:01 2025 UTC |
Description: ------------ When using the two parameter form of the PEAR DB method 'query' ($dbh->query($sql, $parameters)), and using the oci8 driver, query will call $dbh->freePrepared prior to returning which, in the oci8 driver, calls OCIFreeStatement on the OCI statement handle, which causes OCI to discard the results. The solution was to comment out the call to OCIFreeStatement. In that case, caller of $dbh->query must remember to free the statement by calling $results->freeResults(). Reproduce code: --------------- require_once('DB.php'); $dbh =& DB::connect('oci8://user:pass@db'); $result = $dbh->query('SELECT ? FROM DUAL', array('5')); if (DB::isError($result)) { print 'Error from query: '.$result->toString(); } else { print "No Error\n"; $row = $result->fetchRow(); if (is_null($row)) { print "No Rows\n"; } else { print "Result is: $row[0]"; } } Expected result: ---------------- No Error Result is: 5 Actual result: -------------- No Error No Rows