For some reason this isnt working and its most likley because im rough around the edges, any help please?
Trying to get the sum of a specific product and how many times its been ordered. I get incorrect values fromt the echo.
<?php $presum = $db->Execute("select sum(products_quantity) as products_ordered, products_id
from ".TABLE_ORDERS_PRODUCTS . "
where products_id = '" . $products->fields['products_id']. "'
group by products_id ");