use or_like with where condition in codeigniter

$this->db->like('body'$body);$this->db->or_like('author'$author);
You can do it like this

$this->db->where('id', $id);
$this->db->where('(`title` LIKE \'%'.$title.'%\' OR `body` LIKE \'%'.$body.'%\' OR `author` LIKE \'%'.$author.'%\')'NULLFALSE);

Comments

Popular posts from this blog

Merge JS and CSS file to make your codeigniter website faster using CARABINER library