|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64411 ?(question sign) in mysql query comment
Submitted: 2013-03-12 09:54 UTC Modified: 2013-03-14 15:10 UTC
From: pingvein at gmail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.4.12 OS: Linux debian 3.2.0-4-amd64 #1 SM
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:
Bug Type:
From: pingvein at gmail dot com
New email:
PHP Version: OS:


 [2013-03-12 09:54 UTC] pingvein at gmail dot com
question sign in sql comment perceived as a parameter.

Test script:

$dbhost ='localhost';
// username and password to log onto db server
$dbuser ='root';
$dbpass ='test';
// name of database
$db = new PDO ( 'mysql:host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass);

$sth = $db->prepare("SELECT * from users where id = :user /* find user by id script ?\ */");
$sth->execute(array(':user' => 1));

Expected result:
Exception not thrown

Actual result:
Exception is thrown


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-14 14:12 UTC] pingvein at gmail dot com
Change Package
 [2013-03-14 14:12 UTC] pingvein at gmail dot com
-Package: PECL +Package: PDO related
 [2013-03-14 15:10 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

This is a limitation in PDO's parser.This can't easily be fixed as people might rely on it (in workarounds etc.) and as the parser would have to become driver and database version-specific
 [2013-03-14 15:10 UTC]
-Status: Open +Status: Not a bug
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Mar 03 04:01:23 2021 UTC