pdo::__construct($dsn, $user, $pass, array(pdo::mysql_attr_init_command => "set names 'utf8';"));
// 方法二:
pdo::__construct($dsn, $user, $pass);
pdo::exec("set names 'utf8';");
两种方法都能解决问题, 原理一样的, 使用哪中看自己喜欢了
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!