Afternoon,
I have been trying forever to get this displaying correctly. What I need it to do is group first by status then group by classification. Which I kind of have but, I need to break the array up into peices. Right now it shows up as one long string of data.
like so:
Trailers that are currently 3rd Party0 BH
3rd PartyNorth HatfieldMay 5 2005 12:00AM03304PAD APRODUCEVAN04:531
3rd PartyNorth HatfieldMay 5 2005 12:00AM14042TSPARTSTHERMO KING03:47
This is how I would like to see it:
Trailers that are currently 3rd Party
BH
3rd Party North Hatfield May 5 2005 03304 PAD A PRODUCE VAN 04:53
3rd Party North Hatfield May 5 2005 14042 TS PARTS THERMO KING 03:47
Any insight you can offer would be great.
Thanks
Laura
php:include("UpLoad/connect.php");
//load it all into the associative array
$sql = "SELECT * from dbo.vwDailyAMReport
WHERE Source = 'North Hatfield'
AND UpLoadDate = '05/05/2005'
order by Status,Classification";
$result = mssql_query( $sql);
while($row = mssql_fetch_row($result))
{
$status = $row[1];
$classification = $row[0];
$trailers[$status][] = $row;
}
foreach($trailers as $status=>$some_class)
{
//echo "<br />\n Trailers that are currently ". $status . "<br />\n";
echo "<br />\n Trailers that are currently ". $status;
foreach($some_class as $classification=>$some_trailers)
{
echo "<table><tr><td>";
echo $classification;
foreach($some_trailers as $trailer)
{
echo "</td><td>";
echo "<td>$trailer</td>";
echo "</td></tr></table>";
}
}
}
echo "Total Trailers: ". mssql_num_rows($result);
?>