add users to mailing list - bought a specific product

hi all i have " x " product and there is 2000 customers bought that product



is there is a way to extract there emails and add them to the mailing list ??



if extract from sql please help in the Query



and also how to add them to mailing list one time

Items in an order are contained in cscart_order_details table. In there are product_id's and product_code's. So if you wanted to get the email for everyone who ordered product code 'xyz' then you'd do something like (not tested but you can debug):


SELECT o.email FROM cscart_order_details AS od
LEFT JOIN cscart_orders AS o ON o.order_id = od.order_id
WHERE od.product_code='xyz'

thx alot for u i will try it now



i just try it and enter the product code but the result was



MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0002 sec )



any help ?



by the way

i did not found the email in the



cscart_order_details

email comes from the cscar_orders table (alias 'o').

The goal was to give you something to work with, not something that was tested and verified.

Since thw query did not error out, you should break it down into it's pieces and debug it.

thx a lot for u i will try my best to do it :)

great i have now all the emails



any aide how to insert them into the mailing list one time ?