Don't throw an exception when the database query fails
This commit is contained in:
parent
ce762b4154
commit
14f0a1a1ed
1 changed files with 1 additions and 0 deletions
|
@ -138,6 +138,7 @@ class Database
|
||||||
try {
|
try {
|
||||||
$this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]);
|
$this->connection = @new PDO($connect, $user, $pass, [PDO::ATTR_PERSISTENT => $persistent]);
|
||||||
$this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->pdo_emulate_prepares);
|
$this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, $this->pdo_emulate_prepares);
|
||||||
|
$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT);
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
$this->connected = false;
|
$this->connected = false;
|
||||||
|
|
Loading…
Reference in a new issue