PEAR is archived and read-only

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

Home » Database » DB » Bug #2368

Using getRow() with an mysql UPDATE command results in a fatal error

Details

Submitted2004-09-21 22:28 UTC
Fromsebastian at herbajet dot com
Assigneddanielc
StatusBogus
PackageDB
PHP Version4.2.2
OSLinux
Roadmaps(Not assigned)

Comments

[2004-09-21 22:28 UTC] sebastian at herbajet dot com

Description:
------------
When i use getRow() with an mysql UPDATE command results
in a fatal error. This is of course not the right use of
the function but it shouldnt result in a PHP fatal error

Reproduce code:
---------------
$db_result = $this->content->db->query("UPDATE users SET firstname='$firstname', lastname='$lastname', email='$email', telephone='$telephone' WHERE id='$id'");
if(DB::isError($db_result))
die($db_result->getMessage());

Expected result:
----------------
the row in the database should get update or just return
false since i should use query insted?!

Actual result:
--------------
Fatal error: Call to a member function on a non-object
in /usr/share/php/PEAR/DB/common.php on line 765