Hey guys, here is my problem. I am writing a Drupal module. A user uploads a CSV list of e-mail addresses to a server in a form. I need to do a JOIN on my database to get a list of unique addresses from the CSV file and the DB (No, it is not for spam :).
How would I turn the uploaded CSV file into a format that I can do an SQL join on it with a table in my db in php?
You can load it directly using LOAD DATA INFILE
Or, if you prefer, read it in PHP with fgetcsv(), munge to your heart’s content, and them INSERT into a temporary table.