Skip to content

Commit

Permalink
Connect error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
h2lsoft committed Nov 9, 2020
1 parent ed5d189 commit bb1398b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DBManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ public function connect($driver='mysql', $host='localhost', $username='root', $p
{
$dsn = "{$driver}:host={$host};dbname={$database};port={$port}";

error_interceptor(1);
$this->error_interceptor(1);
$this->connection = new PDO($dsn, $username, $password, $pdo_options);
$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
error_interceptor(0);
$this->error_interceptor(0);

return $this->connection;
}
Expand Down

0 comments on commit bb1398b

Please sign in to comment.