# Grouping data with PHP

**URL:** <https://forum.kirupa.com/t/grouping-data-with-php/218043>\
**Category:** programming\
**Created:** [March 4, 2007, 3:15pm UTC](https://forum.kirupa.com/t/grouping-data-with-php/218043 "2007-03-04T15:15:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [March 4, 2007, 3:15pm UTC](https://forum.kirupa.com/t/grouping-data-with-php/218043/1 "2007-03-04T15:15:53Z")

</div>

I have a PHP file that is returning all the values from a MySql Database. They are a list of car types.

The variables are being sent to Flash. I need a way to group this information into similar car types and then a way to tell flash how many there are of each group and how many groups there are.

Something like this:

&grandtotal=30&totalnumberofgroups=5&group1total=4&group1car1=AudiA6&group1car2=AudiA6&group1car3=AudiA6&group1car4=AudiA6&group2total=3&group2car1=BMW 3 Series&group2car2=BMW 3 Series &group2car3 =BMW 3 Series…etc

Is this possible with PHP/MySql?

Any help much appreciated.Thank you.
