diff options
Diffstat (limited to 'user_guide/database')
-rw-r--r-- | user_guide/database/active_record.html | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index d53630402..874dda58e 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -337,7 +337,6 @@ $this->db->or_where('id >', $id); <li><strong>Simple key/value method:</strong> <code>$this->db->like('title', 'match'); - <br /><br />// Produces: WHERE title LIKE '%match%' </code> <p>If you use multiple function calls they will be chained together with <var>AND</var> between them:</p> @@ -356,6 +355,13 @@ $this->db->or_where('id >', $id); $this->db->like('title', 'match', 'both'); <br /> // Produces: WHERE title LIKE '%match%' </code> </li> +If you do not want to use the wildcard (%) you can pass to the optional third argument the option 'none'. + +<code> + $this->db->like('title', 'match', 'none'); <br /> +// Produces: WHERE title LIKE 'match' +</code> + <li><strong>Associative array method:</strong> <code> @@ -794,7 +800,6 @@ $query = $this->db->get();</code> <p class="important"><strong>Note:</strong> Method chaining only works with PHP 5.</p> <a name="caching"> </a> - <h1>Active Record Caching</h1> <p>While not "true" caching, Active Record enables you to save (or "cache") certain parts of your queries for reuse at a later point in your script's execution. Normally, when an Active Record call is completed, all stored information is reset for the next call. With caching, you can prevent this reset, and reuse information easily.</p> |