[UPHPU] Deduping a list
Gary Thornock
gthornock at yahoo.com
Wed Jul 26 21:22:06 MDT 2006
--- Wade Preston Shearer <lists at wadeshearer.com> wrote:
>> One list is a .csv file and the other is in mysql. I have a
>> server with LAMP on it so I can import both there and do it
>> there if it's the best place.
>
> Databases are not my forté, so you will most likely get a
> better answer from somewhere else, but I would put the good
> list into an MySQL table, then read the short list into an
> array, and then loop through it comparing it to the good list
> and when there is a match, remove that row.
If I were doing it, I'd put both lists into MySQL in separate
tables and run a query like this to produce the new list:
CREATE TABLE cleaned_list AS
SELECT a.*
FROM
old_list a
LEFT OUTER JOIN unsub_list b
ON a.email = b.email
WHERE b.email IS NULL;
Then you can (if you like) drop the old_list table and use the
cleaned_list table as the new list.
More information about the UPHPU
mailing list