I have been trying to get the subgroup total of the data below using the method in the accepted answer here: how to group result in subgroups in php, but to no avail. Somebody please help.
I want this:
+---------------+-----------------+
| Type | Price |
+---------------+-----------------+
| Music | 19.99 |
| Music | 3.99 |
| Music | 21.55 |
| Toy | 89.95 |
| Toy | 3.99 |
+---------------+-----------------+
displayed as this:
Music | 45.53
Toy | 93.94
in group and subtotal.
Try this…