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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: robhines at sbcglobal dot net
New email:
PHP Version: OS:

 

 [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-2021 The PHP Group
All rights reserved.
Last updated: Sun Dec 05 14:03:37 2021 UTC