[eluser]jcavard[/eluser]
Your database information belongs in the database config file
(system/application/config/database.php). Why would you put this info in each of your controllers? This is the point of OO, avoid redundancy. If you set the db info properly in the database.php config file, you should have no need to pass any $config array, it will look it up automatically.
And if you have multiple databases, again, look in the User_Guide for a detailed how-to, but to make it short,
Code:
// Connect to $config['default']
$this->load->database();
// Connect to $config['myOtherDB']
$this->load->database('myOtherDB')
config/database.php EXAMPLE
Code:
// In your case, the data you took out of the controller would go here in the 'default'
$db['default']['hostname'] = 'host';
$db['default']['username'] = 'usr';
$db['default']['password'] = 'pwd';
$db['default']['database'] = 'db';
$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['myOtherDB']['hostname'] = 'XE';
$db['myOtherDB']['username'] = 'hr';
$db['myOtherDB']['password'] = 'hr';
$db['myOtherDB']['database'] = '';
$db['myOtherDB']['dbdriver'] = 'oci8';
$db['myOtherDB']['dbprefix'] = '';
$db['myOtherDB']['pconnect'] = TRUE;
$db['myOtherDB']['db_debug'] = TRUE;
$db['myOtherDB']['cache_on'] = FALSE;
$db['myOtherDB']['cachedir'] = '';
$db['myOtherDB']['char_set'] = 'utf8';
$db['myOtherDB']['dbcollat'] = 'utf8_general_ci';
As for the break, it's unlikely that I will give you any...(H)