Zen Follower
- Join Date:
- Apr 2009
- Location:
- Edinburgh
- Posts:
- 130
- Plugin Contributions:
- 0
mySQL query to retrive products and its attributes from customers' basket?
Hi there
I need some help with mySQL
I had an order in online shop where money had been received (its lying on a bank account), but the order has not reached the system. So, I have no idea what customer ordered. It happend twice already
What I need is a mySQL query I can process to retrive the data from phpMyAdmin. This is what I have so far:
*SELECT cb.customers_id, c.customers_firstname, c.customers_lastname, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, c.customers_email_address, c.customers_telephone, p.products_id, p.products_model, cb.customers_basket_quantity, p.products_price
FROM customers_basket cb, customers c, products p, address_book ab
WHERE cb.customers_id = XXXX
AND c.customers_id = cb.customers_id
AND c.customers_default_address_id = ab.address_book_id
AND p.products_id = SUBSTRING_INDEX(cb.products_id, ':', 1)
*
and it works perfectly. However one products is with attributes (colours). The question is: how to change the query so it retrives product attributes as well?