From:             pingvein at gmail dot com
Operating system: Linux debian 3.2.0-4-amd64 #1 SM
PHP version:      5.4.12
Package:          PECL
Bug Type:         Bug
Bug description:?(question sign) in mysql query comment

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 bug report at https://bugs.php.net/bug.php?id=64411&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64411&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64411&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64411&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64411&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64411&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64411&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64411&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64411&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64411&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64411&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64411&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64411&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64411&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64411&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64411&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64411&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64411&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64411&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64411&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64411&r=mysqlcfg


-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to