11-16-2009, 01:06 PM
[eluser]majidmx[/eluser]
hi there,
You should specify two sets of DB configs :
and then in your model's code you have load them separately :
and then use it like this :
Hope it helps,
MajiD
hi there,
You should specify two sets of DB configs :
Code:
$db['db_write']['hostname'] = "localhost";
$db['db_write']['username'] = "user";
$db['db_write']['password'] = "pass";
...
$db['db_read']['hostname'] = "localhost";
$db['db_read']['username'] = "user";
$db['db_read']['password'] = "pass";
...
and then in your model's code you have load them separately :
Code:
$this->DBr = $this->load->database('db_read', TRUE);
$this->DBw = $this->load->database('db_write', TRUE);
and then use it like this :
Code:
$db_result = $this->DBr->query('SELECT * FROM myTable');
Hope it helps,
MajiD