Welcome Guest, Not a member yet? Register   Sign In
$this->db->start_cache cached the session id?
#1

[eluser]Unknown[/eluser]
it is quite weird..

in controller, I want to cache a where condition :

$this->Field_model->db->start_cache();
$this->Field_model->where("field_notes like '%{$search_key}%'");
$this->Field_model->db->stop_cache();

$this->Field_model->list();

it is only a get function in list(), so, the query is supposed to be :
SELECT * FROM (`fields`) WHERE (field_notes like '%not%')

but, actually, the query turn out to be :

SELECT COUNT(*) AS `numrows` FROM (`fields`) WHERE `session_id` = '542c54e2b22814424729fb2f9b6efc56' AND (field_notes like '%not%')

the session is stored in db.

so, is it a bug, or I miss something?
#2

[eluser]megabyte[/eluser]
I am not sure why this happens either, but using flush cache fixes it for me.




Theme © iAndrew 2016 - Forum software by © MyBB