|
发表于 2018-6-25 14:33:27
|
显示全部楼层
本帖最后由 飘扬过海 于 2018-6-25 14:35 编辑
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => '127.0.0.1:123',
'username' => 'root',
'password' => 'root',
'database' => 'root',
'dbdriver' => 'mysqli',
'dbprefix' => 'pay_',
'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
);
$db['support'] = array(
'dsn' => '',
'hostname' => '127.0.0.1:234',
'username' => 'root',
'password' => 'root',
'database' => 'root',
'dbdriver' => 'mysqli',
'dbprefix' => 'yang_',
'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
);
要使用那个链接在你的model里这样就行了:
function __construct(){
parent::__construct();
$this->db = $this->load->database('support', true);
}
|
|