开发者

mssql_connect in PHP does not exist

I've been struggling with this for a while now and I don't 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 directive to c:PHP\ext and uncommented:

    extension = php_mssql.dll
    
  • I moved the dll file to c:windows\system32\
  • I downloaded the 200.80.194.0 version of ntwdblib.dll and placed it in c:\windows\system32
  • I restarted my web server client

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 it's helpful, I'm running PHP 5.3.2, IIS, and Microsoft SQL Server 2008.


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).


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜