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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -