2 回答

TA貢獻1809條經驗 獲得超8個贊
我在 Azure SQL 文檔快速入門中發現的內容:使用 PHP 查詢可能丟失了“UID”參數的 Azure SQL 數據庫。
<?php
$serverName = "your_server.database.windows.net"; // update me
$connectionOptions = array(
"Database" => "your_database", // update me
"Uid" => "your_username", // update me
"PWD" => "your_password" // update me
);
//Establishes the connection
$conn = sqlsrv_connect($serverName, $connectionOptions);
?>
您可以先測試 Alberto Morillo 的代碼。
希望這可以幫助。

TA貢獻1821條經驗 獲得超6個贊
您可以嘗試如下所示連接嗎?請看用戶名。
在 ~/.freetds.conf 上添加 [aftermath]:
[aftermath]
database = mydatabase
host = cjweb.database.windows.net
port = 1433
tds version = 8.0
$myServer = "aftermath"
$myUser = cjweb@cjweb
$myPass = your_password
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Couldn't connect to SQL Server on $myServer");
- 2 回答
- 0 關注
- 191 瀏覽
添加回答
舉報