Welcome Guest, Not a member yet? Register   Sign In
Active Record Cache doesn't work with delete
#6

[eluser]JeffChan[/eluser]
[quote author="inparo" date="1218221464"]Active Record clears after every query it runs, so the where clause is gone when the second delete query runs.
Code:
$tables = array('projects', 'comments', 'media');
$this->db->where('id', $this->uri->segment(3));
$this->db->delete($tables);


Also, in my mind delete counts as a 'write-type' query..::confused::
Quote:Only read-type (SELECT) queries can be cached,
[/quote]

Yeah that's correct, but keep in mind here that we're caching the "where" query not the "delete" query.

So theoretically, the where clause should have been cached when using $this->db->start_cache()/$this->db->stop_cache() and applied to subsequent queries until a flush.

Edit: Oops sorry. I think we're not on the same page... I was refering to the Active Record Cache not the database query cache.


Messages In This Thread
Active Record Cache doesn't work with delete - by El Forum - 08-07-2008, 05:51 AM
Active Record Cache doesn't work with delete - by El Forum - 08-07-2008, 01:07 PM
Active Record Cache doesn't work with delete - by El Forum - 08-07-2008, 07:58 PM
Active Record Cache doesn't work with delete - by El Forum - 08-08-2008, 07:51 AM
Active Record Cache doesn't work with delete - by El Forum - 08-08-2008, 08:13 AM
Active Record Cache doesn't work with delete - by El Forum - 08-08-2008, 09:55 AM
Active Record Cache doesn't work with delete - by El Forum - 08-08-2008, 10:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB