diff options
author | Joseph Wensley <jwensley2@gmail.com> | 2011-10-07 04:53:29 +0200 |
---|---|---|
committer | Joseph Wensley <jwensley2@gmail.com> | 2011-10-07 04:53:29 +0200 |
commit | f24f404a34081241c1398f568b506e2c9d9bec5b (patch) | |
tree | 061763329891ffccb78a6c55955b2528e8cb89a5 /user_guide_src/source/database/caching.rst | |
parent | 1b9732987f28f1b47f59c68303613c6977300580 (diff) |
cleaning up and formatting database pages
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() ========================== |