Edit report at http://bugs.php.net/bug.php?id=51477&edit=1
ID: 51477
User updated by: cage dot liu at gmail dot com
Reported by: cage dot liu at gmail dot com
Summary: bind chinese Param to prepare statment return null
Status: Open
Type: Bug
Package: PDO related
Operating System: windows2003
PHP Version: 5.2.13
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2010-04-05 13:46:59] cage dot liu at gmail dot com
please turn off
------------------------------------------------------------------------
[2010-04-05 13:28:48] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51477&edit=1