// NO PROBLEM WITH IT
$dbhandle = mssql_connect(TB_DB_SERVER, TB_DB_USERID, TB_DB_PASSWORD) or die("Database connection error.");
$imageDBhandle = mssql_connect(TB_IMAGE_SERVER, TB_IMAGE_USERID, TB_IMAGE_PASSWORD) or die("Database connection error.");
// THIS WORKS FINE TOO
mssql_select_db("database", $dbhandle);
$sql_query = "SELECT * FROM table1";
$result = mssql_query($sql_query, $dbhandle);
// THIS COMPLAINS - message: Invalid object name 'table2'
mssql_select_db("anotherDatabase", $imageDBhandle );
$sql_query = "SELECT * FROM table2";
$result = mssql_query($sql_query, $imageDBhandle );
mssql_connect 和 mssql_select_db 在执行代码时从不抱怨。但是,第二个代码似乎有一个奇怪的问题。为什么第二部分给我一个错误?