I,m using PHP3
ok heres what going on (it's a shopping cart)
I'm placing a number into a cookie this number is coming from a MySQL DB and is repersents a product. user chooses a product and insert it into the cart and clicks checkout at this point the products are now inserted into the DB and the valuse are displayed (everything fine at this point.
At checkout there are two fields. $qty and $price qty being stored in the cookie and price being drawn from the DB. These two values are being multipled together and saved in $s_total. Let say there are three items in the cart
item1 | 22.00 | 2 | 44.00
item2 | 11.00 | 1 | 11.00
item3 | 9.00 | 2 | 18.00
now price and qty total are in $s_total
I want to loop thorugh $s_total and add all the results together.
44.00
11.00
18.00
73.00
So I should have a total of 73.00 in $g_total
Hope you can understand this and help me out been trying to solve this for two days using foreach before I reallized thats only for PHP4
TIA
Richie TM