How to delete multiple rows? How to delete multiple rows? database database

How to delete multiple rows?


Have you tried this ?

$names = array(4,5);$this->db->where_in('id', $names);$this->db->delete('mytable');


not need of associative array.

$ids[] = 1;$ids[] = 2;$this->db->where_in( id, $ids );$this->db->delete('Table_Name');


write custom query for it

$this->db->query("DELETE FROM `TABLE_NAME` WHERE `id` IN(1,2,3,4,5)");