Can't connect mssql server 2005 using wamp server 2.2.11
Posted by: venkat437 (---.2.68.58.aircel.co.in)
Date: August 28, 2009 11:22AM

Hi all ,

I have tried but unable to connect to mssql server 2005

please help me in step by step procedure to connect mssql server 2005. I am using wamp server 2.2.11

I have tried the following code


$conn = mssql_connect("servername", "uname","Pw" ) or die("Couldn’t connect to SQL Server" );

mssql_select_db('shasdev', $conn) or die("Couldn’t connect to Server database." );


mssql_close($conn);


I have got following error


Fatal error: Call to undefined function mssql_connect() in C:\wamp\www\mssql_test\connect_test.php on line 13

could any one please advice me how to configure apache setting and further process.

Thanks,
venkat437.

Options: ReplyQuote
Re: Can't connect mssql server 2005 using wamp server 2.2.11
Posted by: cut_off (202.155.31.---)
Date: April 01, 2010 09:56AM

i have same problem too... any body can tell how it error...

Options: ReplyQuote
Can't connect mssql server 2008 using wamp server
Posted by: oast (---.telebucaramanga.net.co)
Date: August 19, 2011 03:27PM

good morning I tried to connect to sqlserver 2008 R2 through the library but when gender php_mssql.dll the query for me to connect to DB generates the following error: Fatal error: Call to undefined function mssql_connect () in C: \ .. .. And configure the php.ini as stated in the forums corresponddiente place the library and no, I'm working through seven windows.

Options: ReplyQuote
Re: Can't connect mssql server 2005 using wamp server 2.2.11
Posted by: jinhr (---.smh.toronto.on.ca)
Date: August 19, 2011 03:49PM

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.

Options: ReplyQuote


Sorry, only registered users may post in this forum.