Hi,
I have a mysql query that brings in a list of results, say 10, each with its own 'last edited' date, and was wondering if it was possible to display/echo/print ONLY the most recent of these dates using php?
Now I know I could do this with a mysql query, but I need to display all of the available results, but only 1 date, (the most recent).
Hope this makes sense. Any help greatly appreciated. S.
<?php
$availQuery=mysql_query("select * from isavailability");
$availResult=mysql_fetch_array($availQuery);
$date = $availResult['editDate'];
$newDate = date('D dS F Y',strtotime($date));
$time = date('G:i:s',strtotime($date));
echo '<p>This page was last updated on '.$newDate.' at '.$time.'</p>' . PHP_EOL;
while($availR=mysql_fetch_array($availQuery)) {
echo '<tr class="rows">'. PHP_EOL;
echo '<td><p>'.$availR['title'].'</p></td>'. PHP_EOL;
echo '<td>'; if ($availR['availability']==1) { echo $tick; } else { echo $cross; } echo '</td>'. PHP_EOL;
echo '<td>'; if ($availR['availability']==2) { echo $tick; } else { echo $cross; } echo '</td>'. PHP_EOL;
echo '<td>'; if ($availR['availability']==3) { echo $tick; } else { echo $cross; } echo '</td>'. PHP_EOL;
echo '</tr>'. PHP_EOL;
}
?>