or_not_like() Query in Codeigniter

This tutorial shows you how to write or not like query in codeigniter. This method is identical to not_like(), except that multiple instances are joined by OR.

Let’s create a or_not_like method in codeigniter

$this->db->like('title', 'php');
$this->db->or_not_like('body', 'article');
// WHERE `title` LIKE '%php% OR  `body` NOT LIKE '%article%' ESCAPE '!'

Leave a Reply

Your email address will not be published. Required fields are marked *