graham23s Posted February 13, 2008 Share Posted February 13, 2008 Hi Guys, i have a table with prices in them kind of like: id price user_id 1 2.00 1 2 3.50 6 3 4.25 1 say i want the total price of all the users (1 in this case) which would be 2.00 and 4.25 what would be the best way to get the total price i can't think of a way lol cheers Graham Quote Link to comment https://forums.phpfreaks.com/topic/90996-getting-the-total-price/ Share on other sites More sharing options...
laffin Posted February 13, 2008 Share Posted February 13, 2008 [/sql]SELECT SUM(price) as total FROM table WHERE user_id=1[/sql] I Wud think that wud work Quote Link to comment https://forums.phpfreaks.com/topic/90996-getting-the-total-price/#findComment-466367 Share on other sites More sharing options...
graham23s Posted February 13, 2008 Author Share Posted February 13, 2008 thanks mate perfect:) Graham Quote Link to comment https://forums.phpfreaks.com/topic/90996-getting-the-total-price/#findComment-466373 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.