简体   繁体   中英

Connect to MSSQL Server via PHP

I have MSSQL 2008 installed on my production server. I want to operate on that data remotely via php. As I went through a lot of articles and installed 'php_sqlsrv_54_ts.dll' and 'php_sqlsrv_54_nts.dll' files in my ext folder and enable them in my php.ini file. But still I am getting following error:

Fatal error: Call to undefined function mssql_connect()...

Please help me out how could I do this?

php_sqlsrv_54_ts is not the extension files for the mssql extension, which is no longer supported when connecting from PHP hosted on Windows. php_sqlsrv_54_ts is for SQLSRV and you need to connect using sqlsrv_connect .

Just in case the above is less than clear... You have the right extension installed, meaning the one that is newer and preferred. You are using the wrong functions. You don't need to, nor should you, try to enable the mssql extension. You simple need to use the sqlsrv extension functions instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM