PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB2 » Bug #9740

Missing meaningful error for fetchRows()

Details

Submitted2007-01-05 07:14 UTC
Fromit at sux2b dot us
Assignedquipo
StatusBogus
PackageMDB2
PHP Version5.1.6
OSLinux
Roadmaps(Not assigned)

Comments

[2007-01-05 07:14 UTC] it at sux2b dot us

Description:
------------
Got a bit of a error popping up when trying to utilize numRows() with an incorrect SQL query.

"Fatal error: Call to undefined method MDB2_Error::numRows()"

All you need to do is a quick query on a table, selecting data from a column that doesn't exist, and instead of giving a error suggesting your query is broken, it spits out the above error instead.

Wasn't sure if this was as intended, but thought I'd make the report anyway.

Test script:
---------------
$res =& $mdb2->query('select somecolumnthatdoesntexist from table');
echo $res->numRows(); // The error will apparently be caused here.
$mnth->free();

Expected result:
----------------
An Error message detailing the issues with the SQL query, as per the norm with other functions.

Actual result:
--------------
Fatal error: Call to undefined method MDB2_Error::numRows();

A vague error message that doesn't indicate any issue with the query specified.