Database loop
I have a database that has several hundred rows. I would like to create a loop that would cycle through the database and group rows together based on the values contained in 1 field. We will call the field 'unit_type'. This field has a few possible values: administration, staff or student. How would I create a loop that would group rows with the same value for 'unit_type' together. I will be writing these groups to a web page. I'm primarily concerned with the best method to create this loop. Any help is appreciated.
|