Get An Email List Out of Your osCommerce Database

I’ve found it necessary to get an email list out of a few osCommerce stores so that I can export that data to a mailing house.

Please note that this SQL doesn’t look at the customer’s newsletter selection – our external company handles whether or not they wish to receive e-mail from us. So you may have to join the customers table in here.


SELECT DISTINCT customers_company, customers_name, customers_email_address
FROM orders
WHERE date_purchased <= '2008-11-10 23:59:59'
ORDER BY customers_company, customers_name, customers_email_address

It’s probably overkill to have all those fields specified in ORDER BY, but I only have a couple thousand addresses and a big powerful machine. I’m sure MySQL can handle it.

I used phpMyAdmin to execute this query and export to a tab delimited csv.

Facebook comments: