<?php
$server = "sqlsvr\MSSQLSERVER, 1433";
$connectionInfo = array( "Database"=>"TAURAS_CENRES2", "UID"=>"sa", "PWD"=>"texset");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
?>
这是我的代码,但它不起作用。我需要使用php连接SQL Server,但它无法正常工作。
答案 0 :(得分:0)
尝试使用connect mssql
的服务器语法$server = 'serverName\MSSQLSERVER, 1433';