PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #6043

query

Details

Submitted2005-11-23 11:15 UTC
Fromandregoncalo dot bras at gmail dot com
Assigneddanielc
StatusBogus
PackageDB
PHP VersionIrrelevant
OSwindows
Roadmaps(Not assigned)

Comments

[2005-11-23 11:15 UTC] andregoncalo dot bras at gmail dot com

Description:
------------
When i run the query method on a update statement, and suppose that return error, the method is returning me an DB_result Object, instead of Db_Error.

Test script:
---------------
$sql = "updte eds_schedules set sch_description = '" . $_POST['description'] . "'," .
" sch_shift = '" . $_POST['shift'] . "'" .
" where sch_id = " . Misc::escapeInteger($_POST['sch_id']);
$query = $GLOBALS["db_api"]->dbh->query($sql);
print_r($query);
if (PEAR::isError($query))
$query = $GLOBALS["db_api"]->dbh->rollback();
else
$query = $GLOBALS["db_api"]->dbh->commit();

Expected result:
----------------
the $query variable should be an DB_Error object.

Actual result:
--------------
the $query variable is a DB_Result object.