I have an array like this
array([0]=> 'email@email.com', [1]=> 'email2@email.com', [2]=> 'email3@email.com');
I also have a table with hunders of emails on it.
I want to be able to delete all of these emails apart from the ones that are in the array.
I tried this code but nothing happens:
$emails = join(', ', $emails);
$sql = "DELETE FROM emails WHERE customer_id='".$id."' AND email NOT IN(".$emails.")";
$query = $this->db->query($sql);
Can anyone tell me where I am going wrong?
Thanks
Peter