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 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 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 Link to comment https://forums.phpfreaks.com/topic/90996-getting-the-total-price/#findComment-466373 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.