php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56257 "DB Error: syntax error" when editing a bug
Submitted: 2004-12-30 04:04 UTC Modified: 2004-12-30 11:00 UTC
From: kouber@php.net Assigned: danielc (profile)
Status: Closed Package: PECL bug system (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kouber@php.net
New email:
PHP Version: OS:

 

 [2004-12-30 04:04 UTC] kouber@php.net
Description:
------------
A "DB Error: syntax error" is thrown when I try to edit a bug and change the e-mail address (supply an e-mail in the "New email" field). Without providing information in that field everything works just fine.

So, I took a look at the source code:
http://cvs.php.net/co.php/pearweb/public_html/bugs/bug.php?r=1.72
and I thing I've found the bug. It is on line 275:           

$query .=  "email='{$_POST['in']['email']}',";

there have to be a leading space in the string assigned to $query:

$query .=  " email='{$_POST['in']['email']}',";

Otherwise, the query becomes "UPDATE bugdb SETemail=...", which is of course, syntactically incorrect.

Here it is the patch:

275c275
<             $query .=  "email='{$_POST['in']['email']}',";
---
>             $query .=  " email='{$_POST['in']['email']}',";


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-30 11:00 UTC] danielc at analysisandsolutions dot com
Thanks for reporting it and figuring it out.  Fixed in CVS.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Jan 21 08:03:35 2022 UTC