From:             albert at jool dot nl
Operating system: Debian Sarge
PHP version:      5.1.2
PHP Bug Type:     PDO related
Bug description:  mysql error when using named parameters in a query with high 
ascii

Description:
------------
Create a PDO_MYSQL connection ($db in the example code). Prepare a query
with high ascii values between single quotes (update queries are often
affected) and one or more named parameters. Execute the query. 

Reproduce code:
---------------
$query = "
        SELECT          'ï' as test
        FROM            test
        WHERE           id = :id";
$stm = $db->prepare($query);
$stm->execute(array(":id" => 1));

Expected result:
----------------
No errors, query is correct when executed directly under mysql.

Actual result:
--------------
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near ':id' at line 3

-- 
Edit bug report at http://bugs.php.net/?id=36798&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36798&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36798&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36798&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36798&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36798&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36798&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36798&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36798&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36798&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36798&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36798&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36798&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36798&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36798&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36798&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36798&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36798&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36798&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36798&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36798&r=mysqlcfg

Reply via email to