mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 16:32:45 +00:00
More code to support ancient PHP versions
This commit is contained in:
parent
7cb40db874
commit
e06b02b67e
@ -108,10 +108,14 @@ final class Settings {
|
||||
$dsn .= ';charset=utf8';
|
||||
}
|
||||
|
||||
$options = array(
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_EMULATE_PREPARES => false,
|
||||
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
|
||||
);
|
||||
|
||||
try {
|
||||
$this->conn = new PDO($dsn, $username, $password);
|
||||
$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$this->conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
|
||||
$this->conn = new PDO($dsn, $username, $password, $options);
|
||||
} catch (PDOException $e) {
|
||||
Settings::handle_error($this, $e);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user