This commit is contained in:
Фёдор Подлеснов 2016-10-07 16:01:47 +03:00
parent af80a4f0ec
commit 5dac5a6e19
2 changed files with 3 additions and 2 deletions

View file

@ -26,6 +26,7 @@ class Database extends PDO
if ($dsn['phptype'] == 'pgsql' || $dsn['phptype'] == 'mysql') {
$port = (isset($dsn['port'])) ? "port={$dsn['port']};" : "";
$connection = new Database("{$dsn['phptype']}:host={$dsn['hostspec']}; $port dbname={$dsn['database']}", $dsn['username'], $dsn['password']);
$connection->query('SET client_encoding = "UTF-8"');
}
if ($dsn['phptype'] == 'sqlite') {
$connection = new Database("{$dsn['phptype']}:{$dsn['database']}");