views:

42

answers:

2

I've been struggling with this for a while now and I dont know what I'm missing. The error is "call to undefined function mssql_connect()" Having looked into it already I've done about everything I can. I moved the php.ini file to c:windows. In the ini I changed the extension_dir to "c:PHP\ext" and uncommented extension = php_mssql.dll. I then moved the dll file to c:windows\system32. I also downloaded the 200.80.194.0 version of ntwdblib.dll and placed that in c:windows\system32 as well. Finally I restarted my web server client. And yet php is still not recognizing the function and library classes.

I'm stumped as to what I didn't do right and would love some help. If its helpful I'm running php 5.3.2, IIS, and Microsoft SQL Server 2008

+2  A: 

For SQL Server 2008 on Windows it's sqlsrv_connect This is because Microsoft now uses the SQL Driver for PHP which is now on version 2.0 I believe.

Also it's worth noting that with sqlsrv_query, and mssql_query they switched the parameters around (spent half an hour figuring that out).

klennepette
+1  A: 

You say you are running PHP 5.3.2. The PHP manual states:

This extension is not available anymore on Windows with PHP 5.3 or later.

The PHP MSSQL library is ancient and is no longer considered a viable option.

You should instead examine PDO with either the MSSQL driver or the more reliable ODBC driver.

Microsoft are still developing their own PDO driver. Version 2 was made available June 2010. Microsoft recommend the more stable version 1.1 for production use.

Jon Cram
thank you very much. this appears to be solving that specific problem.
E. Criss