CodeIgniter Forums
Problem with deleting particular cache - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with deleting particular cache (/showthread.php?tid=52797)



Problem with deleting particular cache - El Forum - 06-27-2012

[eluser]Unknown[/eluser]
Hello.

I have this model:
Code:
public function Vote($data) {
    $gameid = $this->input->post('gameid');
    $userid = $this->input->post('userid');
    $rate = $this->input->post('rate');

    $ins = array(
        'user_id' => $userid,
        'game_id' => $gameid,
        'rate' => $rate
    );

    $q = $this->db->insert('rates', $ins);

    $this->db->cache_delete('games',$gameid);
}
Which is pretty straight-forward, right? I turn cache on, but when I submit the form, I want it deleted. So I wrote cache_delete with controller 'games' and id brought from the hidden input. But it doesn't work. Using cache_delete_all works thought.

Inserting data in this model works aswell.