开发者

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

开发者 https://www.devze.com 2023-02-26 13:38 出处:网络
I have a zend application currently not displaying utf-8 en开发者_如何学Gocrypted special characters.

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

精彩评论

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