I have a question involving PHP arrays and adding up the values.
I have an access database with information in this scheme
----------------------
| time | code |
|------|-------------|
| 600 | broke down |
| 500 | broke down |
| 300 | waiting |
| 200 | waiting |
| 400 | remove coil |
Anyways, you get the idea. I have multiple code values, but can have multiple time values for one code. What I am trying to accomplish with PHP is to add up all time values and only display one code value.
The result I want would be:
1100 | Brokedown (600 & 500 added together)
500 | Waiting (300 & 200 added together)
400 | Remove Coil
Just for example. I think I should be using a multidimensional array, but I just cannot seem to wrap my head around what to do exactly with it. A point in the right direction would be greatly appreciated.
Why not SQL?
Time is a reserved word, so I guess it is an imaginary name. If it is real, you must enclose it in square brackets, or better, change it.