in reply to Sorting data pulled in by DBI

You can specify multiple ORDER BY fields in your SQL statement. Something along these lines would get you the data in the right order:
...ORDER BY college, student_id

Once you've got that, you could set up your output loop so that it compares the current value of college to the one in the previous record; if it's different, you print a header with the new information. Something like this (untested):

my $college_last =''; while (@row = $sth_report->fetchrow_array) { # assign $student_name etc. print "<h1>$college</h1>" if $college ne $college_last; $college_last = $college; # print the actual record contents }