I am trying to find the best way to see if multiple email addresses already exist in my database. I have a table with member id's, emails, and other info, and I need to import members but to check if members already exist. The amount of member that I will import will vary because it will be CSV files from users.
I dont want to make a really long "email LIKE OR " ... etc.
I was thinking of making a temporary table and then union that table to my members table, but worried about performance. Any other ideas?
I read in a lot of names and email addresses, and I need to check if those email addresses are already in the database. But instead of making numerous calls to the DB, or a really long where clause similar to "WHERE email LIKE '' OR email LIKE '' OR ...", I wanted to find a better way or getting emails that are either already in the database.
In the end, I did something like this for the where clause:
"email IN ('" . implode( "','", $inviteEmails ) . "')"
$inviteEmails is an array of emails I am going to insert as users for the site.