开发者

zend framework, mysql: How do I Set name utf-8 in application.ini

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜