Okay I was a little confused so I went to the manual. Anyway I have kind of what I want but instead of iterating through all the results it stops at the first.
There should be 4 records only one is showing up. Heres what I have:
/* connect to db */
$connection=mssql_connect("HQMSDB05") or die("Problem connecting");
if (!$connection) {
echo "Could not connect to Sql server!";
exit;
}
//load it all into the associative array
$sql = "SELECT Source,TrailerID,Status,Length,OwnershipType,Location,Classification,Contents,
FleetGroup,Description,DoorType FROM Yardcheck.dbo.vwRentalReturns where Source = 'Aberdeen' order by Source";
$result = mssql_query($sql);
while($row = mssql_fetch_row($result)) {
$myArray[$row[0]] = $row[1];
}
//now we expand it
while(list($Source,$TrailerID) = each($myArray)) {
echo $Source;
echo $TrailerID;
echo "<br>";
}
?>
What I get is:
AberdeenU24311
What I would like to see is
Aberdeen
U24311
2400
2411
098924
Then to be extra special I would count at the bottom:
total trailers: 4
But I digress. Can anyone point my confused brain in the right direction. Thanks ever so much
Laura