Hey guys, just having a little trouble with some php code of mine. Im sorting a sql database using date but it seems to use a sorting of both date and alphbetical, this can be seen here ->
http://frozenpea.net/date.php
Feburary and March are rihgt but april has been put up top for some reason. The code is as follows:
<?
$db = mysql_connect('localhost','user','password');
mysql_select_db("db", $db);
$sql="SELECT * FROM CDS ORDER BY Date";
$result = mysql_query($sql,$db);
$num = mysql_num_rows($result);
$cur = 1;
echo "<TABLE cellSpacing=1 cellPadding=2 width=\60%\" border=0 bordercolor=\"#000000\" bgcolor=\"#000000\"><TBODY>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$artist = $row["Artist"];
$cd = $row["CD Name"];
$date = $row["Date"];
echo "<TR bgcolor=\"#6F9986\"><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">$artist</font></td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">$cd</font></td></font></td><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">$date</font></td>";
$cur++;
}
echo "</TBODY></table>";
?>
If anyone can help me out and edit my code so its lists only in date, ie april down the bottom as well, it would be greatly appreciated. Thanks a lot,
Regards,
Stewart