I have an query that pulls values from a table. The values are Items and Qty. What I'm trying to do is create an array of the Items and their total quantities.
<?php $UNITS = array(); $UNITS[$result['Item']] .= $result['Qty']; ?>
Now this just adds the number to the number that already exists in the array.
How do I add the values of waht is in the array to the new value and put it back into the array?
List is something like:
Widget1 - 14
Widget2 - 3
Widget2 - 5
Widget3 - 2
Widget1 - 6
So I would have: