forked from leftypol/leftypol
database.php: set utf8mb4 charset
This commit is contained in:
parent
88564ca12e
commit
d6bb4d21d8
1 changed files with 1 additions and 4 deletions
|
@ -66,7 +66,7 @@ function sql_open() {
|
|||
|
||||
$dsn = $config['db']['type'] . ':' .
|
||||
($unix_socket ? 'unix_socket=' . $unix_socket : 'host=' . $config['db']['server']) .
|
||||
';dbname=' . $config['db']['database'];
|
||||
';dbname=' . $config['db']['database'] . ';charset=utf8mb4';
|
||||
if (!empty($config['db']['dsn']))
|
||||
$dsn .= ';' . $config['db']['dsn'];
|
||||
try {
|
||||
|
@ -84,9 +84,6 @@ function sql_open() {
|
|||
|
||||
if ($config['debug']) {
|
||||
$debug['time']['db_connect'] = '~' . round((microtime(true) - $start) * 1000, 2) . 'ms';
|
||||
if ($config['db']['type'] == "mysql") {
|
||||
query('SET NAMES utf8') or error(db_error());
|
||||
}
|
||||
}
|
||||
return $pdo;
|
||||
} catch(PDOException $e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue