about how PHP connection database, we certainly have different views, some with Wamp, some with xamp, they are integrated environment, convenient operation.
Sometimes, however, the database type is different and you want to connect to a different database. Today share with you how to connect the sql2000, the server environment for the iis,php version of the 5.2 version.
1. Install PHP:
1) Open "programs and Features" and click "Turn window features on or off".
2) Tick "IIS Admin Console" and CGI, OK.
3) Open IIS Manager and you will see the "FastCGI" setting.
4) Download and install the PHP Manager (X86). You can then see the PHP Manager in IIS Manager.
5) Download PHP version, unzip to the specified directory, then open IIS Manager, double-click the PHP Manager icon, click Register New PHP version, in the pop-up window, enter or select the Php-cgi.exe in the previously unzipped directory. Click OK.
6) Click Check Phpinfo (), select a site to check the PHP environment, check whether PHP installation is successful.
2. Modify the contents of php.ini in PHP:
1) the No. 689 line; extension=php_mssql.dll the front; remove.
2) Change the display_errors=off of line No. 373 to Display_errors=on.
3) the No. 342 line; Error_reporting=e_all &~e_notice the front; remove.
3.config.php (Connection database)
<?php
$host = ' localhost ';
$user = ' sa ';
$pass = ' 123456 ';
$dbname = ' users ';
$con = Mssql_connect ($host, $user, $pass) or Die ("Connection Server failed! ");
$db = mssql_select_db ($dbname) or Die ("Database selection failed! ");
?>
Note: php5.3 the above version does not have the MSSQL extension, so the above content only adapts to the php5.2 version.
I also see a lot of methods on the Internet, through repeated attempts and pondering, and finally successfully connected to the database, I would like to share the experience of this article, I hope that the network of small partners can like.
PHP Connection SQL Server related configuration and instructions