php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21430 BuildManipSQL is not returning the correct query when building an update stmt
Submitted: 2003-01-05 07:51 UTC Modified: 2003-01-05 08:15 UTC
From: ritzcoder at yahoo dot com Assigned:
Status: Closed Package: PEAR related
PHP Version: 4.3.0 OS: Windows XP
Private report: No CVE-ID: None
 [2003-01-05 07:51 UTC] ritzcoder at yahoo dot com
Hello. I would like to report a bug in common.php of the pear:DB class. In the function buildManipSQL, the code is incorrectly building the sql statement.  You have the following starting on line 528:
if ($where) {
$sql .= " WHERE $sql";
}

This code repeats the entire query after the where clause.  Instead it should read:
if ($where) {
$sql .= " WHERE $where";
}

Just wanted to report this - it was frustrating me for a while and I decided to peek inside and see what the problem was.  Hope this helps.

By the way, I searched for this bug but did not see it anywhere yet.  If someone has reported it already, sorry for the double post.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-05 08:16 UTC] fab@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the report. Of course, your patch is correct. Yet, it was already fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC