问题
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