php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54421 bindValue does not process utf-8 encoded strings.
Submitted: 2011-03-30 01:30 UTC Modified: 2011-05-10 14:00 UTC
From: will dot skates at ntlworld dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.3.6 OS: Found on win and linux(centos)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
26 - 20 = ?
Subscribe to this entry?

 
 [2011-03-30 01:30 UTC] will dot skates at ntlworld dot com
Description:
------------
I'm currently developing a piece of software system for a Russian client. When set names is set as utf8 in both execute and as one of the options in the PDO construct, no results are returned when a utf8 string is bound using bindValue();

Test script:
---------------
$stmt = $pdo->prepare('SELECT * FROM table WHERE column LIKE ?');
$stmt->bindValue(1,\'%привет%\');
$stmt->execute();

$result = $stmt->fetchAll(PDO::FETCH_ASSOC);

var_dump($result);

Expected result:
----------------
array(1) { "column" => "привет" }

Actual result:
--------------
array(0){}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-10 09:28 UTC] uw@php.net
-Status: Open +Status: Feedback
 [2011-05-10 09:28 UTC] uw@php.net
What exactly does this mean: "when set names is set as utf8 in both execute and as one of the options in the PDO construct"? Please, provide complete test script including "set names ... options in the PDO construct".
 [2011-05-10 09:28 UTC] uw@php.net
... and what database are you talking about. PDO works with many.
 [2011-05-10 14:00 UTC] will dot skates at ntlworld dot com
-Status: Feedback +Status: Closed
 [2011-05-10 14:00 UTC] will dot skates at ntlworld dot com
Please have my sincere apologies, this issue has been resolved. I'll file a fix soon.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 12:01:29 2024 UTC