You can group them as you read them in; with each possible status getting its own array. Then you can loop through all of the statuses, and for each status, loop through all the classifications.
$trailers
while($row = mssql_fetch_row($result))
{
$status = $row['status'];
$trailers[$status][] = $row;
}
Then you'll have an array $trailers with elements like $trailers['Do Not Use'], which is itself an array of all the trailers with an Off Rent status.
So after you've got your data into the form you want, you can loop through it to display:
foreach($trailers as $status=>$some_trailers)
{
echo "Trailers that are currently $status";
foreach($some_trailers as $trailer)
{
echo "trailer #".$trailer['TrailerId'];
}
}
There is of course nothing stopping you from having a richer data structure:
$trailers
while($row = mssql_fetch_row($result))
{
$status = $row['status'];
$classification = $row['Classification'];
$trailers[$classification][$status][] = $row;
}
will group all the trailers by classifcation (wood, etc. I'm guessing), and then for each classifcation, group them by status.