Skip to content

Commit

Permalink
v1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
emalherbi committed May 24, 2018
1 parent 89ca40c commit 5496d4a
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/MyMssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,23 @@ public function connect()
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $e) {
$err = $e->getMessage();
$this->logger('MyMssql Connect', $err);
die(print_r($e->getMessage()));
$this->logger('MyMssql Connect '.$this->ini['ADAPTER'], $err);

try {
if ('SQLSRV' !== $this->ini['ADAPTER']) {
$driver = "sqlsrv:server=$hostname; database=$database";
} else {
$driver = "mssql:host=$hostname; dbname=$database";
}

$this->db = new PDO($driver, $username, $password);
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $e) {
$err = $e->getMessage();
$this->logger('MyMssql Connect '.$this->ini['ADAPTER'], $err);

die(print_r($e->getMessage()));
}
}
}

Expand Down

0 comments on commit 5496d4a

Please sign in to comment.