Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need SQL help


Guest

Recommended Posts

Posted

Can someone please help me out I am trying to get a list of all the customers email address out of the database where the customers place a order.

 

please send me the sql code

Posted

The customers email address is actually stored in the orders table so you could simply

 

select customer_email_address from orders.

 

If you want more info you could do

select o.customers_email_address,op.products_name,op.products_quantity from orders o, orders_products op where

o.orders_id=op.orders_id

 

Not sure why osCommerce stores the email in the orders table as well as the customer table, maybe you can specify a new email when your buy..

Posted

Keep in mind that this will select all customers that have an order of any type of order status.

 

For example, if you have an order statrus of "PayPal Processing" or "Cancelled" or "Returned" or "Pending" all of these will be included.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...