Hi,
I have 4 databases in the config.
my model is something like:
and from the controller, I do something like
This works fine . with this I am able to connect to 4 additional database and pull all info @ once.
The issue here is that the $thisdb->cache_on(); on the model is not working. The connection takes the same amount of time even if that line was not there.. and then, I do not see any pages being created on application/cache
another thing to note, the profiler only shows the main $db query .. for the additional ones, it does not.
so how would I do db query cache here ?
Thanks
I have 4 databases in the config.
my model is something like:
PHP Code:
function get_total($dbkey){
// this $dbkey is the additioanl databases specified in the config
$thisdb = $this->load->database($dbkey, TRUE);
$thisdb->cache_on();
$query = $thisdb->query("select count(*) as total from dbname.tablename");
$row = $query->row();
return $row;
}
and from the controller, I do something like
PHP Code:
$this->load->model('mydb')
$db2total_users = $this->mydb->get_total("db2"):
$db3total_users = $this->mydb->get_total("db3"):
$db4total_users = $this->mydb->get_total("db4"):
$db5total_users = $this->mydb->get_total("db5"):
This works fine . with this I am able to connect to 4 additional database and pull all info @ once.
The issue here is that the $thisdb->cache_on(); on the model is not working. The connection takes the same amount of time even if that line was not there.. and then, I do not see any pages being created on application/cache
another thing to note, the profiler only shows the main $db query .. for the additional ones, it does not.
so how would I do db query cache here ?
Thanks