Welcome Guest, Not a member yet? Register   Sign In
Database caching problem
#1

[eluser]veledrom[/eluser]
Hi,

I wan to cache ONLY one query out out hundreds and my setting are shown below. However no cache file created. Do I miss anything?

Thanks

path
I didn't create one, just using existing 'cache' folder (htaccess and index file in it) under 'application' folder.
Code:
application/cache

database.php
Code:
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = './application/cache/';

function in model
Code:
function return_year(){
   $this->load->database();
   $this->db->protect_identifiers('year');
   $this->db->cache_on();
   $data['result'] = $this->db->query('SELECT id FROM year');
}
return $data['result'];
#2

[eluser]veledrom[/eluser]
OK ignore it. It works now. There was a if statement causing problem in controller.
Regards




Theme © iAndrew 2016 - Forum software by © MyBB