Use SQL Server Driver for PHP to solve the problem of PHP connection MSSQL garbled

Source: Internet
Author: User
Tags sql server driver

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.