This commit is contained in:
Roly Rudy Gutierrez Pinto
2018-12-20 16:45:51 -04:00
parent 8a854f7657
commit 3d8e15bb00
4 changed files with 77 additions and 65 deletions

View File

@@ -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')) {