codeigniter-base-model
codeigniter-base-model copied to clipboard
"like" statement for search !
trafficstars
Hello, how we can use the like statement ???
exmp :
$this->db->like('title', 'match');
// Produces: WHERE title LIKE '%match%'
get all posts that title contains the "match" string.
Tnx.
+1 for this feature
http://www.codeigniter.com/user_guide/database/query_builder.html implementation (in MY_Model)
public function like($field, $match = '', $side = 'both', $escape = NULL) {
$this->_database->like($field, $match, $side, $escape);
return $this;
}
thnx michail1982 :)
+1 for this feature. nice work @michail1982 this should be added into the next version. If the creator of this doesn't plan on updating anymore, then maybe we should create a new one fork.