|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2016-07-01 21:43 UTC] kir dot morozov at gmail dot com
[2016-08-01 05:21 UTC] sungtae542 at gmail dot com
[2016-09-14 21:47 UTC] adambaratz@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: adambaratz
[2016-09-14 21:47 UTC] adambaratz@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 21:00:01 2025 UTC |
Description: ------------ MSSQL BindParam with UTF8 Character in PHP 7.0.4 and PHP 7.0.7 then UTF8 character is modified. PHP 5.5.6 is OK. PHP 7.0 without bindparam and just pdo-dblib with UTF8 is ok. PHP 7.0 with bindparam pdo-mysql UTF8 is ok. PHP 7.0.4-7ubuntu2.1 (Ubuntu 16.04 Package) PHP 7.0.7 (php-7.0.7.tar.gz) Ubuntu 16.04 + PHP7.0.4 PDO_dblib + parambind(UTF8) + mssql : Fail Ubuntu 16.04 + PHP7.0.7 PDO_dblib + parambind(UTF8) + mssql : Fail Ubuntu 16.04 + PHP7.0.? PDO_dblib + parambind(Ansi) + mssql : OK Ubuntu 14.04 + PHP5.5.9 PDO_dblib + parambind(UTF8) + mssql : OK Ubuntu 16.04 + PHP7.0.4 PDO_dblib + UTF8 query + mssql : OK Ubuntu 16.04 + PHP7.0.4 PDO_mysql + parambind(UTF8) + mysql : OK Ubuntu 16.04 + freetds + tsql + mssql : OK Test script: --------------- # with bindparam $pdo = new PDO("dblib:host=$dbIp;dbname=$dbName;charset=UTF-8", $dbId, $dbPw); #$username = 'username1'; $username = '한글'; $sth = $pdo->prepare("select * from test_table where username = :username"); $sth->bindParam (':username', $username); $sth->execute(); $row = $sth->fetch(PDO::FETCH_OBJ); var_dump($row); #without bindparam $pdo = new PDO("dblib:host=$dbIp;dbname=$dbName;charset=UTF-8", $dbId, $dbPw); #$username = 'username1'; $username = "'" . "한글" . "'"; $sth = $pdo->prepare("select * from test_table where username = $username"); $sth->execute(); $row = $sth->fetch(PDO::FETCH_OBJ); var_dump($row); Expected result: ---------------- freetds debug log and MSSQL Profiler log is following select * from test_table where username = '한글' Actual result: -------------- freetds debug log and MSSQL Profiler log is following select * from test_table where username = 0x27ed959ceab88027