I have found this codeigniter active record query where I can delete items in an array
$this->db->delete('stack', array('id' => $id))
However, I would like to delete items which are not in the array.
Is this possible.?
This should do the trick:
$this->db->where_not_in('id', $ids);
$this->db->delete('stack');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With