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.'%\')', NULL, FALSE);

Comments

Popular posts from this blog

Various platform for PHP Development

Enable the imap in support in xampp server