|
|||
|
Sometimes the count of the "products ordered" (table: products, field: products_ordered) is not real. It contains the user installation order test, delete orders or others irrelevant orders. Easy to solve, next query update the product_ordered counting the order table.
Query to update the product_ordered, execute it in your MySQL Query Manager (like PhpMyAdmin) Code:
UPDATE products
SET products_ordered = (
SELECT SUM( products_quantity ) AS total
FROM orders_products
WHERE orders_products.products_id = products.products_id
GROUP BY products_id)
Good luck and Good night!
http://www.albertserra.cat/ - Manufacturers in product detail (product_info) - Show the customer phone in print orders - Custumer name in cart box - Prototype & Scriptaculous to build a Banner in a homepage -- Albert Serra Senior PHP Developer info@senior-php-developer.com info@albertserra.cat http://www.senior-php-developer.com/ http://www.albertserra.cat/ |
![]() |
| Lesezeichen |
| Stichworte |
| count, ordered, products, trick, update |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Trick! Update your Products Ordered count | argv64 | English Community Forums | 0 | 07.11.2009 23:52 |
| Trick! Update your Products Ordered count | argv64 | Allgemeine Diskussionen | 0 | 07.11.2009 23:31 |
| Ist Das Absicht Oder Programmierfehler ? | smogware | Allgemeine Diskussionen | 12 | 18.12.2004 10:21 |