Skip to content

Instantly share code, notes, and snippets.

@ryo-utsunomiya
Created September 6, 2014 18:58
Show Gist options
  • Save ryo-utsunomiya/f5613d81918901bd196b to your computer and use it in GitHub Desktop.
Save ryo-utsunomiya/f5613d81918901bd196b to your computer and use it in GitHub Desktop.
PhalconのDbAdapterにchareset=utf8を渡す(MySQL) ref: http://qiita.com/ryo511/items/b6fcbca8fd4287a13043
$con = new PDO('mysql:host=localhost;dbname=test;charset=utf8', 'dbuser', 'password');
$db = new Phalcon\Db\Adapter\Pdo\Mysql([
'dsn' => 'mysql:host=localhost;dbname=test;charset=utf8',
'username' => 'dbuser',
'password' => 'password',
]);
$db = new Phalcon\Db\Adapter\Pdo\Mysql([
'host' => 'localhost',
'username' => 'dbuser',
'password' => 'password',
'dbname' => 'test',
'charset' => 'utf8',
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment