问题
So I have a trouble here. Tried use mssql_connect() but interpeter says that function is undefinied. PHP.net advices this, but it suppports only older versions of PHP. Is it possible to connect to MS SQL Server database from PHP5.6? What extensions should I add, what functions can I use?
Configuration details: localhost, Apache 2.4, PHP 5.6, OS Windows 8.
回答1:
You need to enable the MSSQL extension in the PHP.ini file.
If this extension is not installed, you need to install it in PHP.
Please tell your server details (OS/WebServer like apache nginx) so that I can explain in detail.
回答2:
Use
<?php phpinfo();?>
to see what are available with your php installation. I advice you to use PDO instead of mysql_* functions. It supports several databases not only MSSQL or MySQL.
来源:https://stackoverflow.com/questions/25833043/working-with-ms-sql-server-on-php5-6