in reply to Sorting
assuming you still want to sort on the 1st column. Enough of sorting.my $ref = $st->fetchall_arrayref; my @sorted = sort { $a->[1] cmp $b->[1] } @$ref;
I assume you want one TR per row in your select's result set. But the way you have it coded, you'll produce one entire HTML document with one TR for each row returned from your database; you have too much code inside your WHILE. You need to only have the TR code in side your loop. Something like:
my $sth = ... print [all your html including the TABLE tag ] while (@row = ... { print [ code for each row] } print [ rest of html doc ]
|
|---|