I have an array like this
array([0]=> '[email protected]', [1]=> '[email protected]', [2]=> '[email protected]');
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