Overcoming PHP/SQL Server encoding inconsistency -
following this blog post, managed connect mssql server form php/centos machine. can result, can not use comparison in where
clause. should due different encoding. here code:
$db = new pdo("odbc:users", "username", "password"); $sql = "select top 1 name user name='تست'"; $stmt = $db->prepare($sql); $result = $stmt->execute(); $row = $stmt->fetch(pdo::fetch_assoc); var_dump($row);
also using $name = mb_convert_encoding('تست', 'utf16');
(also 'ucs-2le' encoding) not helpful. how config php/mssql use single encoding?
Comments
Post a Comment