开发者

Call to undefined function mssql_connect()

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!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜