diff options
author | Timothy Warren <tim@timshomepage.net> | 2011-10-07 15:55:27 +0200 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2011-10-07 15:55:27 +0200 |
commit | 486b17c1f39e04c952de995d68412db4d6477c3c (patch) | |
tree | 57a44b04a9cbe570de8f905bb0b2d70c30895cb5 /user_guide_src/source/database/caching.rst | |
parent | ec19332ba3791c933f2221d972ee073684b5ea3b (diff) | |
parent | 0252fc7ddf80262f915b20100107ec79ba3ccf01 (diff) |
Merge branch 'develop' of git://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'user_guide_src/source/database/caching.rst')
-rw-r--r-- | user_guide_src/source/database/caching.rst | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/user_guide_src/source/database/caching.rst b/user_guide_src/source/database/caching.rst index 7a195a7a1..d73120a93 100644 --- a/user_guide_src/source/database/caching.rst +++ b/user_guide_src/source/database/caching.rst @@ -124,7 +124,17 @@ $this->db->cache_on() / $this->db->cache_off() Manually enables/disables caching. This can be useful if you want to keep certain queries from being cached. Example:: - // Turn caching on $this->db->cache_on(); $query = $this->db->query("SELECT * FROM mytable"); // Turn caching off for this one query $this->db->cache_off(); $query = $this->db->query("SELECT * FROM members WHERE member_id = '$current_user'"); // Turn caching back on $this->db->cache_on(); $query = $this->db->query("SELECT * FROM another_table"); + // Turn caching on + $this->db->cache_on(); + $query = $this->db->query("SELECT * FROM mytable"); + + // Turn caching off for this one query + $this->db->cache_off(); + $query = $this->db->query("SELECT * FROM members WHERE member_id = '$current_user'"); + + // Turn caching back on + $this->db->cache_on(); + $query = $this->db->query("SELECT * FROM another_table"); $this->db->cache_delete() ========================== |