Hey,
I'm trying to add variables from a query result, and am not sure how to add the same variable (different values, same variable) to itself as many times as it occurs, and reach a sum total.
Hopefully that makes enough sense, but here's the example:
Basically:
while ($db->next_record()){
print $mrc;
}
Now, $mrc (a dollar amount) will come up many times, with a different value each time.
How do I add up the value of each mrc with all the other values of mrc?
Do I count and somehow use those results?
Possibly make an array of some sort and explode it?
I am a newbie, but I have scoured the manual and these forums, so hopefully I have not missed an obvious answer somewhere.
And hopefully this is the right forum...
thanks very much