Bug #64411 [Opn->Nab]: ?(question sign) in mysql query comment

From: Date: Thu, 14 Mar 2013 15:10:44 +0000
Subject: Bug #64411 [Opn->Nab]: ?(question sign) in mysql query comment
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-177790@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64411&edit=1

 ID:                 64411
 Updated by:         johannes@php.net
 Reported by:        pingvein at gmail dot com
 Summary:            ?(question sign) in mysql query comment
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            PDO related
 Operating System:   Linux debian 3.2.0-4-amd64 #1 SM
 PHP Version:        5.4.12
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

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


Previous Comments:
------------------------------------------------------------------------
[2013-03-14 14:12:01] pingvein at gmail dot com

Change Package

------------------------------------------------------------------------
[2013-03-12 09:54:12] pingvein at gmail dot com

Description:
------------
question sign in sql comment perceived as a parameter.

Test script:
---------------
<?php

$dbhost ='localhost';
// username and password to log onto db server
$dbuser ='root';
$dbpass ='test';
// name of database
$dbname='test';
//Charset
$sqlchar='utf8';
 
$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));
$sth->fetch();

Expected result:
----------------
Exception not thrown

Actual result:
--------------
Exception is thrown


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64411&edit=1


Thread (1 message)

  • johannes@php.net
  • Unknown Message
    • johannes@php.net
« previous php.bugs (#177790) next »