I have an array of about 1,000 emails like ['a@a.com', 'b@b.com', ..., 'zz@zz.com']
that I need to check. If an email exists in the account table, I need to pull the first and last name of the row that matches the email in the account table.
The account table looks like this:
CREATE TABLE account (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
email VARCHAR(255) NOT NULL,
first_name VARCHAR(255),
last_name VARCHAR(255)
);
What is the best way to achieve this without looping through the array?