ghost
3 years ago
3 changed files with 8 additions and 10 deletions
@ -1,12 +1,12 @@
@@ -1,12 +1,12 @@
|
||||
<?php |
||||
|
||||
class MySQL { |
||||
class SQLite { |
||||
|
||||
public function __construct() { |
||||
public function __construct($database, $username, $password) { |
||||
|
||||
try { |
||||
|
||||
$this->_db = new PDO('mysql:dbname=' . DB_NAME . ';host=' . DB_HOST . ';port=' . DB_PORT . ';charset=utf8', DB_USERNAME, DB_PASSWORD, [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8']); |
||||
$this->_db = new PDO('sqlite:' . $database, $username, $password, [PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8']); |
||||
$this->_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
||||
$this->_db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); |
||||
$this->_db->setAttribute(PDO::ATTR_TIMEOUT, 600); |
Loading…
Reference in new issue