The original text using SQL Server Driver for PHP to solve the PHP connection MSSQL garbled problem
Recently helped customers write a. NET Mall Web site publishing interface, we all know. NET generally use MSSQL database, but fish balls do not. NET Ah, no way, can only use PHP to connect to SQL Server, and then publish the product data. Because the customer acquisition of English site, but required to be published when translated into German, published, the results found that the title content of these places have garbled, found on the internet for most of the day, also tried a lot of methods, the results using sqlsrv solved the problem!
official website: http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx
Extension: http://www.microsoft.com/download/en/ details.aspx?displaylang=en&id=20098
The client's server is Windows Server r2,php version 5.2.4, download the PHP extension, unzip to the PHP ext directory, add a line in the php.ini: Extension=php_sqlsrv_52_ts_ Vc6.dll, and then restarted IIS, just started testing, still garbled, by reading the Help document, and then solved!
$serverName="127.0.0.1,1433";
$connectionInfo=Array( "UID"="SA",
"PWD"="123456",
"Database"="Nopcommerce",
"CharacterSet"="UTF-8");This line is the point.
$conn =Sqlsrv_connect($serverName, $connectionInfo ) ;
Using SQL Server Driver for PHP to solve the problem of PHP connection MSSQL garbled