I am trying to delete multiple record(s) by using codeigniter
$this->db->delete() and $this->db->where()
I want to delete record(s) with an array like
$id =array(
0=>'13', //13 is the id
1=>'4', //4 is the id
2=>'2' //2 is the id
);
The array was generated by the users so it will be dynamic. I just want to know if codeigniter can take the array as a option in delete method.
According to this. http://codeigniter.com/user_guide/database/active_record.html
array won't work in the following method.
$this->db->delete()
$this->db->where('id', $id); //I don't think I can do this.
I could use foreach to loop but it seems to me there are better ways. I was wondering if anyone could help me about it. Thanks a lot.