$this->db->like()
This method enables you to generate LIKE clauses, useful for doing searches.
$this->db->like('title', 'match');
Produces: WHERE title
LIKE '%match%'
If you want to control where the wildcard (%) is placed, you can use an optional third argument. Your options are ‘before’, ‘after’, ‘none’ and ‘both’ (which is the default).
$this->db->like('title', 'match', 'before');
Produces: WHERE title
LIKE '%match'
$this->db->like('title', 'match', 'after');
Produces: WHERE title
LIKE 'match%'
$this->db->like('title', 'match', 'none');
Produces: WHERE title
LIKE 'match'
$this->db->like('title', 'match', 'both');
Produces: WHERE title
LIKE '%match%'