PDA

View Full Version : Recover missing order info from DB



michael_s
10-22-2008, 04:10 PM
Try this instead of the previous post. I should have used LEFT JOIN instead of JOIN. This way, both orders with products that have attributes and those that don't have attributes are found.

Some people may need products attributes information. Here is the MySQL code to do that. Substitute the actual customer's id for . This SQL statement will find orders whether there are product attributes or not.

SELECT cb.customers_basket_quantity, pd.products_name, pov.products_options_values_name
FROM customers_basket cb
LEFT JOIN products_description pd ON pd.products_id=cb.products_id
LEFT JOIN customers_basket_attributes cba ON cba.customers_id=cb.customers_id
LEFT JOIN products_options_values pov ON cba.products_options_value_id=pov.products_options _values_id
WHERE cb.customers_id =''
AND pd.language_id = '1'


More... (http://addons.oscommerce.com/info/4763)