where_in condition in Codeigniter

0

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

Let’s create a where_in method in codeigniter

$id = array('1', '15', '20');
$this->db->where_in('id', $id);
// Produces: WHERE id IN ('1', '15', '20')