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.. Quote 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? Quote 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* Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/221297-calculating/#findComment-1146190 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.