Zend Framework的Zend_Db设置mysql编码

Standard
$db_cfg = array (
        'adapter' => 'PDO_MYSQL',
	'host' => '192.168.0.8',
        'username' => 'root',
        'password' => '123456',
        'dbname' => 'db',
        'charset' => 'utf8',
	'prefix' => '',
	'driver_options'  => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8')
        );

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.