|
使用的数据库是Mysql
mysql> show variables like "character_set_%";
+--------------------------+---------------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_results | latin1 |
| character_set_server | utf8 |
| character_set_system | utf8 |
-----------------------------------------------------------------------------
database.php 的设置为
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "open_lab";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
添加中文后显示为???,在Windows console下也是??? |
|