Php5.3 how to connect to mssql

Source: Internet
Author: User
In windows, Versions later than PHP5.3 do not support mssql extension. Msdn. microsoft. comen-ussqlserverff657782.aspx first? Click getit to download SQLSRV20.EXE. Decompress the file to ext, the extension folder of php. Open php. ini and add [PHP_PDO_SQLSRV] extensionphp_pdo_sq at the end.

In windows, Versions later than PHP5.3 do not support mssql extension. First http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx? Click get it to download SQLSRV20.EXE. Decompress the file to ext, the extension folder of php. Open php. ini and add [PHP_PDO_SQLSRV] extension = php_pdo_sq at the end.

In windows, Versions later than PHP5.3 do not support mssql extension.

First http://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx? Click get it to download SQLSRV20.EXE.

Decompress the file to ext, the extension folder of php.

Open php. ini and add at the end

[PHP_PDO_SQLSRV]
Extension = php_pdo_sqlsrv_53_nts_vc6.dll
[PHP_SQLSRV]
Extension = php_sqlsrv_53_nts_vc6.dll

Save and restart apache. The following is an example of a simple php connection:

 ”root”,“PWD”=>”root2010″,“Database”=>”master”);$conn = sqlsrv_connect( $serverName, $connectionInfo);if( $conn ){echo “Connection established.\n”;}else{echo “Connection could not be established.\n”;die( print_r( sqlsrv_errors(), true));}?>

I am using the wamp5.1 Integrated Installation Package. Test on windows server 2008. Php5.4 or later versions fail to be tested.

Original article address: php5.3 how to connect to mssql, thanks to the original author for sharing.

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.