In yours, config/database.phpyour database is set to the default group, for example:
$db['default']['hostname'] = 'host';
$db['default']['username'] = 'username';
$db['default']['password'] = 'password';
$db['default']['database'] = 'database';
This allows you to specify other groups, such as:
$db['second']['hostname'] = 'host';
$db['second']['username'] = 'username';
$db['second']['password'] = 'password';
$db['second']['database'] = 'database';
$db['third']['hostname'] = 'host';
$db['third']['username'] = 'username';
$db['third']['password'] = 'password';
$db['third']['database'] = 'database';
Then you can connect to another database using:
$defaultDB = $this->load->database('default', TRUE);
$secondDB = $this->load->database('second', TRUE);
true , , , :
$default->get('table');
$second->get('different_table');