I have a zend application currently not displaying utf-8 en开发者_如何学Gocrypted special characters.
I need to use the command set name utf-8 for my mysql connection. Col. Shrapnel hinted me with this:
$params = array(
'host' => 'localhost',
'username' => 'username',
'password' => 'password',
'dbname' => 'dbname',
'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8;');
);
How do I get
'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8;');
in my application.ini?
It was:
resources.db.params.charset = "utf8"
(Added in the config file)
Thanks to Col. Shrapnel again.
Try with:
database.params.driver_options.PDO::MYSQL_ATTR_INIT_COMMAND=SET NAMES UTF8;
精彩评论