i have multi database connection
default connection is in the database.php
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'ci_database';
$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';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
and i have another connection but i want to config this another connection in models
or can i pass the connections parameters to the database.php ??
If only CodeIgniter covered this is their online user manual. Oh, wait. They do!
http://ellislab.com/codeigniter/user_guide/database/connecting.html
There’s a section entitled “Connecting to Multiple Databases” towards the bottom of the page.