Greetings, All -
I need to do the following:
- In a while statement and MySQL. I count the number of records needing a price.
- I have completed this.
2 Next the $price variable is looking for prices from a CVS call in the while statement.
-I have completed this.
Now, I need to take all the different numbers for each record the while statement retrieves and place it in an array. I do this by $pricesum[] = $price;
-I have completed this.
So at this point I need to add $pricesum[]; together based on the count I performed…
In theory, Say there are 4 records -
I would code this if the number was always static: $result = $pricesum[0]+$pricesum[1]+$pricesum[2]+$pricesum[3];
…to get the combined price from each record in the array.
But as I mentioned, the number isn't always going to be the same -
So my question is, how would I add the arrays together, based on the count I performed, and dynamically add the array together?
Thanks for any help.