Bug #8393 [Opn->Csd]: bug with numRows?
| From: | lsmith@php.net | Date: | Tue, 08 Aug 2006 23:06:09 +0000 |
| Subject: | Bug #8393 [Opn->Csd]: bug with numRows? | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-8277@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=8393&edit=1
ID: 8393
Updated by: lsmith@php.net
Reported By: john dot maxwell at emory dot edu
-Status: Open
+Status: Closed
Id: 8393
Type: Bug
Package: Documentation
Operating System: Linux 2.4.21-40.EL
PHP Version: 4.3.2
New Comment:
This bug has been fixed in CVS.
If this was a documentation problem, the fix will appear on
pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
numRows() only works with 'result_buffering' enabled
I have expanded the documentation.
Previous Comments:
------------------------------------------------------------------------
[2006-08-08 17:45:08] john dot maxwell at emory dot edu
Description:
------------
I really hope I'm not just being a stupid noob here, but I'm not,
there's some inconsistency/vaguery in the documentation regarding
numRows in MDB2. The short of it is, I'm getting:
numrows: [Error message: method not implemented] [Last query: select *
from table where recid < 100 ORDER BY recid]
When I attempt to do a numRows on a result set by following the
documentation that pertains to numRows. This isn't altogether
surprising because the numRows function in MDB2.php reads:
function numRows()
{
return $this->db->raiseError(MDB2_ERROR_UNSUPPORTED, null,
null,
'method not implemented', __FUNCTION__);
}
I'm successfully using MDB2_Driver_oci8 for everything except this
issue. That is to say, the query that I run in my test does indeed
return data. Running Oracle 9.
Test script:
---------------
$options = array(
'debug' => 0,
'result_buffering' => false,
'emulate_database' => false,
);
$query = "select * from table where recid < 100 ORDER BY recid";
$mdb2 =& MDB2::connect($dsn, $options);
if (MDB2::isError($mdb2)) {
die($mdb2->getMessage());
}
$res =& $mdb2->query($query);
while ($row = $res->fetchRow())
{
echo $row[0];
}
new dBug($res);
$n = $res->numRows();
// $n =& $res->numRows(); breaks too
if (MDB2::isError($n)) {
echo "<div>ERRORed</div>";
new dBug($n);
}
Expected result:
----------------
I didn't expect to see any error returned.
Actual result:
--------------
Eh, you probably have enough information to identify the bug or call me
an idiot.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=8393&edit=1