You can try MS official PHP extension for SQL Server. It works for me.
==================================
STEP 1 Install Microsoft Drivers for PHP for SQL Server 2.0
==================================
The Microsoft Drivers for PHP for SQL Server provides connectivity to Microsoft SQL Server from PHP applications. It relies on the Microsoft SQL Server Native Client to communicate with SQL Server.
1. Download Microsoft Drivers for PHP for SQL Server 2.0 from [
www.microsoft.com]
2. Run the download file sqlsrv20.exe. It will ask for PHP location. Input "C:\wamp\bin\php\php5.3.5\ext" to finish installation. Some php_pdo_sqlsrv_*.dll and php_sqlsrv_*.dll files will be added to this folder.
3. Enalbe above php extension in your php.ini. NOTICE: you have to choose the right dll. In the *.dll file names,
"pdo" = you may choose this if you want go through PDO
"ts"= thread-safe
"nts" = "non-thread-sage"
"vc6" = "Visual C++ 6 compiled"
"vc9" = "Visual C++ 9 compiled"
4. Restart Apache. Visit [
localhost] and search “sqlsrv” to make sure this extension works.
=============================
STEP 2 Install Microsoft SQL Server Native Client
=============================
1. Download MS SQL Server 2008 R2 Native Client from [
www.microsoft.com]. Choose sqlncli_x86.msi
2. Run and install sqlncli_x86.msi.
==========
STEP 3 PHP codes
==========
You may use sqlsrv_***() functions (provided by MS official extension) now. I believe mssql_***() functions are outdated.
Edited 1 time(s). Last edit at 08/19/2011 03:51PM by jinhr.