[請益] Codeigniter PDO 設定方式

作者: chan15 (ChaN)   2016-03-09 13:39:27
'dsn' => "mysql:host={$config['hostname']};dbname={$config['database']};charset=utf8",
'hostname' => $config['hostname'],
'username' => $config['username'],
'password' => $config['password'],
'database' => $config['database'],
'dbdriver' => 'pdo',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
大家好,這是我的連線檔設定方式,但不知道為什麼寫進中文時會變亂碼
如果 dbdriver 改成 mysqli 就會正常寫入,不知道還有哪邊要變動

Links booklink

Contact Us: admin [ a t ] ucptt.com