or_where_in condition in Codeigniter

The or_where_in methods allows you to specify multiple values in a WHERE clause. Generates a WHERE field IN (‘item’, ‘item’) SQL query joined with OR if appropriate.

Let’s create a or_where_in method in codeigniter

$id= array('10', '20', '30');
$this->db->or_where_in('id', $id);
// Produces: OR id IN ('10', '20', '30')

Leave a Reply

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