我正在使用连接到sqlserver的脚本php,但它不起作用。
//connection to the database
$dbconn = mssql_connect($Server)
or die("Couldn't connect to SQL Server on $Server");
if($dbconn)echo 'Connected';
//select a database to work with
$selected = mssql_select_db($DB, $dbconn)
or die("Couldn't open database $myDB");
![运行脚本时出现此错误,我使用的是Windows身份验证] [1]
答案 0 :(得分:0)
$dbconn = mysql_connect('hostname','username','password');
答案 1 :(得分:-1)
使用mysql_connect()
$dbconn =mysql_connect(servername,username,password);
例如
$con = mysql_connect("localhost","me","123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}