21,893
社区成员




if (!extension_loaded('php_sqlsrv_55_ts.dll')) {
echo "Bad news";
}
Bad news{"code":500,"maxPage":null,"sum":null,"data":[]}
( ! ) Fatal error: Call to undefined function sqlsrv_error() in D:\wamp\www\DemoSqlServer\php\select.php on line 46
Call Stack
# Time Memory Function Location
1 0.0005 153248 {main}( ) ..\select.php:0
Bad news{"code":500,"maxPage":null,"sum":null,"data":[]}Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 ) [1] => Array ( [0] => IM002 [SQLSTATE] => IM002 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC ��������������] δ��������Դ���Ʋ���δָ��Ĭ���������� [message] => [Microsoft][ODBC ��������������] δ��������Դ���Ʋ���δָ��Ĭ���������� ) )
改那个也没用,这是现在的报错信息……
if (!extension_loaded('php_sqlsrv_55_ts.dll')) {
echo "Bad news";
}
我加了这一句,页面输出了Bad News……
//数据库配置
$serverName = "192.168.0.100";
$connInfo = array("Database"=>"Test", "UID"=>"sa", "PWD"=>"admin");
$conn = sqlsrv_connect($serverName, $connInfo);
//连接数据库
if (!$conn)
{
$data = new Data;
$data->code = 500;
$data->data = array();
echo json_encode($data, JSON_UNESCAPED_UNICODE);
die( print_r( sqlsrv_errors(), true));
return false;
}
这是数据库配置和连接