Trying to display a summary table (from data already written) [accumulator?)
« on: Today at 09:41:47 AM »Quote Modify I have pulled out a chronicle of data using 'include' (and strtok) and have displayed it in a table using a While loop. What I need to do is summarize that data. It would be great if foreach wasn't only for array's as I must keep my While loop.
So, I basically just have generic table of data with assigned attributes to work with at the moment.
The data is regarding computers (via serial number), number of times these computers were serviced, and the cost for each repair.
Now I need to display a summary as there are only about 10 computers and many are listed multiple times. In this summary I want to display the total number of times serviced (repaired) and the total cost from all repairs for each computer each on a separate line.
I feel I should be doing something like
....
$cost = $cost + $cost
echo $cost
much like an accumulator but I haven't had any luck with that.
I really just need to be pointed in the right direction.
Thanks
Trying to display a summary table from already listed data
Moderator: General Moderators
-
JasonGreen
- Forum Newbie
- Posts: 7
- Joined: Sun Sep 13, 2009 10:22 am