1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-19 04:41:25 +02:00

Set default db to sqlsrv connection

This commit is contained in:
harryxu
2018-07-18 16:41:12 +08:00
committed by Jakub Vrana
parent 0f08592bc0
commit 94f6a45a2a
2 changed files with 8 additions and 1 deletions

View File

@@ -24,7 +24,13 @@ if (isset($_GET["mssql"])) {
}
function connect($server, $username, $password) {
$this->_link = @sqlsrv_connect(preg_replace('~:~', ',', $server), array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8"));
global $adminer;
$db = $adminer->database();
$connection_info = array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8");
if ($db != "") {
$connection_info["Database"] = $db;
}
$this->_link = @sqlsrv_connect(preg_replace('~:~', ',', $server), $connection_info);
if ($this->_link) {
$info = sqlsrv_server_info($this->_link);
$this->server_info = $info['SQLServerVersion'];