Merged in bugfix/PMC-337 (pull request #6736)
PMC-337 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -253,14 +253,7 @@ class Net
|
||||
break;
|
||||
case 'mssql':
|
||||
//todo
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
} else {
|
||||
if (extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
@@ -274,6 +267,13 @@ class Net
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = @sqlsrv_connect($server, $opt);
|
||||
} else {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
}
|
||||
|
||||
if ($link) {
|
||||
@@ -397,14 +397,7 @@ class Net
|
||||
}
|
||||
break;
|
||||
case 'mssql':
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
} else {
|
||||
if (extension_loaded('sqlsrv')) {
|
||||
if ($this->db_instance != "") {
|
||||
$server = $this->ip . "\\" . $this->db_instance;
|
||||
} else {
|
||||
@@ -418,6 +411,13 @@ class Net
|
||||
'Database' => $this->db_sourcename
|
||||
];
|
||||
$link = $db = @sqlsrv_connect($server, $opt);
|
||||
} else {
|
||||
if ($this->db_instance != "") {
|
||||
$link = @mssql_connect($this->ip . "\\" . $this->db_instance, $this->db_user, $this->db_passwd);
|
||||
} else {
|
||||
$port = (($this->db_port == "") || ($this->db_port == 0) || ($this->db_port == 1433)) ? "" : ":" . $this->db_port;
|
||||
$link = @mssql_connect($this->ip . $port, $this->db_user, $this->db_passwd);
|
||||
}
|
||||
}
|
||||
if ($link) {
|
||||
if (!extension_loaded('sqlsrv')) {
|
||||
|
||||
Reference in New Issue
Block a user