Hi...
I have a site where I need to have the last date a user entered data returned on the user's information page. I tried using the MAX command to get this in the following format (note that I have the "lastdate" being entered into the db in the format "Jun 04 2003"):
while ($row = mysql_fetch_array($result)) {
$callsign = $row['callsign'];
$ahref = "<a href=pilotscbdmissions.php?callsign=$callsign>$callsign</a>";
$aa = $row['SUM(aa_kills)'];
$ag = $row['SUM(ag_kills)'];
$av = $row['SUM(av_kills)'];
$an = $row['SUM(an_kills)'];
$ft = $row['SUM(flight_time)'];
$date = $row['MAX(mission_date)'];
$display_block_score .= "
<tr>
<td align=\"left\"><font size=2><b>$ahref</b></font></td>
<td align=\"center\"><font size=2>$aa</font></td>
<td align=\"center\"><font size=2>$ag</font></td>
<td align=\"center\"><font size=2>$av</font></td>
<td align=\"center\"><font size=2>$an</font></td>
<td align=\"center\"><font size=2>$ft</font></td>
<td align=\"center\"><font size=2>$date</font></td>
</tr>";
}
Today, I was looking at the table and noticed that the last bit of data I entered for myself (which would have been yesterday, Aug 24 2003) wasn't showing up on my user information page. I checked the db itself and my lastdate data was there.
After checking on PHP.Net for more information on the MAX command... I realized my problem. 🙂
Apparently, the MAX is formatting the result output according to the alphebetized month name rather than the date like I had originally thought. So, with August being an "A", none of the August entries are showing up.
So... is there a way to keep my current format more or less intact, or with as few changes as possible, and have my lastdate show up? Or do I need to format my date in another way?
Thanks for any advice...