I have two colume one qty the other price
I want to loop the the table and multipy the qty with the price and the add all totals
ie.
while($sum = mysql_fetch_array($result)) { $sub_total = $sum[qty] * $sum[price]; // this will give me the totals of each row } then in some way add the totals of each row I try user each with list but that didn't work any ideas would be appreciated
Thanks IN Advance
I'm not sure what are you trying to find, but one comment, the whole total you can get using this sql statement:
SELECT sum(qty*price) FROM table;
You do not need to loop through all rows.
Zdenek