ricky_vancouver Posted December 11, 2010 Share Posted December 11, 2010 referring again with to the restaurant db. I want to calculate the total price for the order. how can I calculate the total price of an order..I know its 'amount' x 'quantity' but how to code this.. Link to comment https://forums.phpfreaks.com/topic/221297-calculating/ Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 What "restaurant db" would that be? Where is the code you're having problems with? Link to comment https://forums.phpfreaks.com/topic/221297-calculating/#findComment-1145795 Share on other sites More sharing options...
ignace Posted December 12, 2010 Share Posted December 12, 2010 SELECT amount, quantity, amount * quantity AS total FROM orders WHERE customer_id = .. GROUP BY amount, quantity WITH ROLLUP *MAGIC* Link to comment https://forums.phpfreaks.com/topic/221297-calculating/#findComment-1146113 Share on other sites More sharing options...
ricky_vancouver Posted December 12, 2010 Author Share Posted December 12, 2010 thanks Link to comment https://forums.phpfreaks.com/topic/221297-calculating/#findComment-1146190 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.