Bladephp: Now with 7+ codeigniter, php, and laravel project 7+ php project From $18/Year From Rs. 1000/Year

or_like() Query in Codeigniter

by
Category:codeigniter
codeigniter mysql
or_like() Query in Codeigniter

This tutorial shows you how to write or like query in codeigniter. This method is identical to the one above, except that multiple instances are joined by OR.

Let’s create a or_like method in codeigniter

$this->db->like('title', 'match'); 
$this->db->or_like('body', $match);
// WHERE `title` LIKE '%match%' ESCAPE '!' OR  `body` LIKE '%match%' ESCAPE '!'

Note: or_like() was formerly known as orlike(), which has been removed.


0 Comments


Html code work in comment box


Related Post