Mysql query returns result like this
collector amount name
1 0.00 gihan
1 2000.00 gihan
1 2500.00 gihan
1 11502.00 gihan
2 1140.00 lasita
i want to get array of result like
collector amount count name
1 16002.00 4 gihan
2 1140.00 1 lasita
any idea how to loop result set to get sum for matching collector and same time get count and put result into a new array?
Why do you want to solve this in PHP, when you can have MySQL do the work for you?