Edit report at https://bugs.php.net/bug.php?id=64411&edit=1
ID: 64411
User updated by: pingvein at gmail dot com
Reported by: pingvein at gmail dot com
Summary: ?(question sign) in mysql query comment
Status: Open
Type: Bug
-Package: PECL
+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:
Change Package
Previous Comments:
------------------------------------------------------------------------
[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