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
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:
36 - 7 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 07:01:29 2024 UTC