php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51477 PDO_OCI: bind chinese Param to prepare statment return null
Submitted: 2010-04-05 13:28 UTC Modified: 2014-01-01 12:49 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cage dot liu at gmail dot com Assigned:
Status: Open Package: PDO OCI
PHP Version: 5.2.13 OS: windows2003
Private report: No CVE-ID: None
 [2010-04-05 13:28 UTC] cage dot liu at gmail dot com
Description:
------------
when use prepare statment ,binding chinese string to ? or var return empty result .

Test script:
---------------
$ora = new pdo("oci:dbname=//host:1521/racl;charset=zhs16gbk",$urp_user,$urp_pass,array(PDO::ATTR_PERSISTENT => false));
$sql = "select gh,xm from t where xm like ? order by xmpy";
$stmt = $ora ->prepare($sql);
$stmt->bindParam(1,strtoupper($_GET['xmpy'].'%');
$stmt->execute();
$r = $stmt->fetchAll(PDO::FETCH_ASSOC);

//$r = $ora->query_all("select gh,xm from t where xm like '".iconv('utf-8','gbk',$_GET['xmpy'])."%'");

file charset is utf-8.the build-in sql works fine


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-05 13:46 UTC] cage dot liu at gmail dot com
please turn off
 [2010-04-05 14:11 UTC] cage dot liu at gmail dot com
Test Script works fine
but when the ? more than one
in the sql :
select gh,xm from teachers where gh=? or xmpy like ? or upper(xmpinyin) like ? or xm like ? order by xmpy
chinese works but other filed failed

select gh,xm from teachers where xmpy like ? or upper(xmpinyin) like ? or xm like ? or gh=? order by xmpy
other filed search works but xm failed

only xm filed include chinese
 [2013-06-12 03:55 UTC] ssufficool@php.net
-Summary: bind chinese Param to prepare statment return null +Summary: PDO_OCI: bind chinese Param to prepare statment return null
 [2014-01-01 12:49 UTC] felipe@php.net
-Package: PDO related +Package: PDO OCI
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC