diff options
author | Derek Jones <derek.jones@ellislab.com> | 2011-08-25 14:24:06 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2011-08-25 14:24:06 +0200 |
commit | be72bd2d1cdba222bbbce547e1603de1e4ec7961 (patch) | |
tree | 850711b8f4e981fcd1bf51151b1d71d53f630076 /user_guide/database | |
parent | 4bc4c1476344f96ebb920677f608cb185a48eaed (diff) | |
parent | 9ff6336415f3da2a81142cb23343060df6196ebe (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'user_guide/database')
-rw-r--r-- | user_guide/database/active_record.html | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 3f44fcd5b..92d9614d5 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -334,6 +334,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> @@ -525,7 +532,7 @@ $this->db->insert('mytable', $object); <p>Generates an insert string based on the data you supply, and runs the query. You can either pass an <strong>array</strong> or an <strong>object</strong> to the function. Here is an example using an array:</p> -<code> +<code> $data = array(<br/> array(<br /> 'title' => 'My title' ,<br /> @@ -537,7 +544,7 @@ $data = array(<br/> 'name' => 'Another Name' ,<br /> 'date' => 'Another date'<br /> )<br/> -);<br /> +);<br /> <br /> $this->db->update_batch('mytable', $data); <br /><br /> |