Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

sql server - 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:PHPext and uncommented:

    extension = php_mssql.dll
    
  • I moved the dll file to c:windowssystem32
  • I downloaded the 200.80.194.0 version of ntwdblib.dll and placed it in c:windowssystem32
  • 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...