Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
esyede authored Sep 7, 2024
1 parent 3c9887b commit 06f0c27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions system/database/connectors/sqlserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ class SQLServer extends Connector
public function connect(array $config)
{
$port = isset($config['port']) ? ',' . $config['port'] : '';
$dsn = 'sqlsrv:Server=' . $config['host'] . $port . ';Database=' . $config['database'];

if (in_array('dblib', PDO::getAvailableDrivers())) {
$dsn = 'dblib:host=' . $config['host'] . $port . ';dbname=' . $config['database'];
} else {
$dsn = 'sqlsrv:Server=' . $config['host'] . $port . ';Database=' . $config['database'];
}

return new PDO($dsn, $config['username'], $config['password'], $this->options($config));
Expand Down

0 comments on commit 06f0c27

Please sign in to comment.