Call to undefined function mssql_connect()

≡放荡痞女 提交于 2019-12-25 18:17:03

问题


I always used PHP 5.2.3 version, but now I updated PHP to version 5.3.2.

I have problem with MSSQL, I can`t connect to MSSQL server.

I have downloaded a SQL server driver for PHP 1.1

There are a lot of files, I used php_sqlsrv_53_ts_vc9. Put it on php/ext directory php_sqlsrv_53_ts_vc9.

I have added extension=php_sqlsrv_53_ts_vc9.dll (in php.ini), but it gives an error:

Call to undefined function mssql_connect() in C:\webserver\www\MSSQl\db_mssql.class.php on line 26

I have used:

$serverName = "$sql_server";
$connectionInfo = array( "Database"=>$sql_db_name,"UID"=>$sql_user,"PWD"=>$sql_pass);

 $conn = sqlsrv_connect($serverName,$connectionInfo);
 if( $conn === false )
{
     echo "Could not connect.\n";
     die( sqlsrv_errors());
}

Then all work!


回答1:


Open php.ini ,just add this line
extension=php_sqlsrv_53_ts_vc9.dll

you need to know what compiler do you use

phpinfo();

Compiler MSVC9 (Visual C++ 2008)
Than Add it.



来源:https://stackoverflow.com/questions/2989101/call-to-undefined-function-mssql-connect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!