MS SQL connection with PHP fatal error [duplicate]
I use the following code for connecting php with MS SQL :
$server = 'a.b.c.d';
$link = mssql_connect($server, 'sql_user', 'sql_user_pass');
But it gives the following error开发者_开发问答:
Fatal error: Call to undefined function mssql_connect()
How can I solve this?
Mention that I am using MS SQL (SQL SERVER 2008), PHP 5.3.1, WINDOWS 7.
“mssql” was dropped from PHP 5.3 distribution. Use sqlsrv drivers instead. You can find those at this link PHP drivers for MS-SQL
The MSSQL extension is not activated by default.
Do a phpinfo() to find out which php.ini file is used by your PHP installation
open that php.ini file
uncomment the line saying
;extension=php_mssql.dll
(remove the semicolon)Restart the server if necessary
精彩评论