0

我一直在玩使用 MSSQL 的游戏,但连接一直有问题,因为它一直以undefined.

我对 PHP 不太了解,一个朋友帮我设置了服务器。这是阿帕奇 2.2

$serveruser ="user";
$serverPass = "pass";
$server = "server";

$con = mssql_connect($server, $serveruser, $serverPass);

if (!$con)
    die('Could not connect:');
4

2 回答 2

1
$host="localhost";
$username="root";
$password="";
$dbhandle = mysql_connect($host, $username, $password);
$selected = mysql_select_db("database name",$dbhandle);
if($selected){
    echo "buuraaaa.....my database is selected \o/";
}
else    {
  echo "ohh,,,no its not selected";
}
于 2013-11-07T08:55:55.707 回答
0

连接的基本语法是:-

 mssql_connect("localhost<host name>", "<username>", "<password>");

检查您的主机名、用户名和密码。

于 2013-11-07T05:43:23.243 回答