代码:
var_dump(function_exists('sqlsrv_connect'));
所有变量均已经负值
$connectionInfo = array("UID"=>$uid,"PWD"=>$pwd,"Database"=>"tupoemanager");
$conn = sqlsrv_connect( $serverName,$connectionInfo);
if( $conn == false)
{
echo "连接失败!";
die( print_r( sqlsrv_errors(), true));
}
报错信息
boolean true //证明sqlsrv的扩展已经生效
Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 2 [code] => 2 [2] => [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2]. [message] => [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][SQL Server Native Client 11.0]Login timeout expired [message] => [Microsoft][SQL Server Native Client 11.0]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 2 [code] => 2 [2] => [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [message] => [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) )