[PHP-BUG] Bug #51477 [NEW]: bind chinese Param to prepare statment return null

[email protected] ("cage dot liu at gmail dot com") Mon, 5 Apr 2010 13:28:49 +0200 (CEST)
Newsgroups php.bugs
Message-ID <[email protected]>
From:             
Operating system: windows2003
PHP version:      5.2.13
Package:          PDO related
Bug Type:         Bug
Bug description:bind chinese Param to prepare statment return null

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