mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 01:10:51 +01:00
Ensure UTF-8 for MySQL
This commit is contained in:
parent
b20ba4126a
commit
99979ea41c
@ -44,9 +44,10 @@
|
||||
$dsn .= ';' . $config['db']['dsn'];
|
||||
try {
|
||||
$options = Array(PDO::ATTR_TIMEOUT => $config['db']['timeout']);
|
||||
$options = Array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
|
||||
if($config['db']['persistent'])
|
||||
$options[PDO::ATTR_PERSISTENT] = true;
|
||||
return $pdo = new PDO($dsn, $config['db']['user'], $config['db']['password']);
|
||||
return $pdo = new PDO($dsn, $config['db']['user'], $config['db']['password'], $options);
|
||||
} catch(PDOException $e) {
|
||||
$message = $e->getMessage();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user