PEAR is archived and read-only

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

Home » Database » DB » Bug #2734

error in function buildManipSQL

Details

Submitted2004-11-10 18:32 UTC
Fromcarys at campusregistry dot com
Assigneddanielc
StatusBogus
PackageDB
PHP Version5.0.2
OSlinux
Roadmaps(Not assigned)

Comments

[2004-11-10 18:32 UTC] carys at campusregistry dot com

Description:
------------
i was attempting to use autoExecute (with DB_AUTOQUERY_UPDATE) with a simple where clause and it kept throwing the following error...

Warning: preg_match() expects parameter 2 to be string, object given in /usr/share/pear/DB.php on line 350

I traced autoExecute and found the following puzzling code in buildManipSQL in common.php

Reproduce code:
---------------
...
if ($where) {
$sql .= " WHERE $sql";
}
...

i believe that code should read
if ($where) {
$sql .= " WHERE $where";
}

i made the changes myself and the updates function properly now.