0

我正在使用连接到 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]

http://i.stack.imgur.com/a9ndN.jpg

4

2 回答 2

0

检查mysql_connect()

$dbconn = mysql_connect('hostname','username','password');
于 2013-07-20T08:13:53.537 回答
-1

使用连接mysql_connect()

$dbconn =mysql_connect(servername,username,password);

例子

$con = mysql_connect("localhost","me","123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
于 2013-07-20T08:56:34.087 回答