php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25046 autoUpdate() function within PEAR DB Error Out
Submitted: 2003-08-11 16:23 UTC Modified: 2003-08-12 07:10 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: robhines at sbcglobal dot net Assigned: cox (profile)
Status: Closed Package: PEAR related
PHP Version: 4.3.2 OS: RedHat Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 + 17 = ?
Subscribe to this entry?

 
 [2003-08-11 16:23 UTC] robhines at sbcglobal dot net
Description:
------------
When attempting to use the autoUpdate() function within PEAR DB I was continually getting error msgs. Upon further inspection I traced the problem to an apparent typo on ~line 562 of the /usr/share/pear/DB/common.php file. Here is a snippet of the code I found there:

function buildManipSQL($table, $table_fields, $mode, $where = false)
    <...>
    if ($where) {
        $sql .= " WHERE $sql"; <--BAD CODE [rsh]
    }
    <...>
}

Here is how I modified it so that it now works as advertised.

function buildManipSQL($table, $table_fields, $mode, $where = false)
    <...>
    if ($where) {
        $sql .= " WHERE $where"; //This code works! [rsh]
    }
    <...>
}

I hope that helps. Thanks for all your hard work!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-12 07:10 UTC] cox@php.net
This bug was fixed long time ago, please upgrade your PEAR DB. Thanks anyways.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 03:01:32 2024 UTC