Hello,
I'm trying to sort mysql output based on weather the datetime field in the database has passed today or not.
Here's some of my code, maybe someone could help me out?
$result = mysql_query("SELECT cover100,band,title,band_id,id,rls_date FROM evr_releases ORDER BY rls_date DESC");
while($row = mysql_fetch_array($result)) {
if ($i < 4)
{
$i++;
echo "<td valign=top width=185><a href=releases.php?band_id=".$row["band_id"]. "&id=".$row["id"]. "><img src=images/covers/100/".$row["cover100"]. " width=100 height=100 border=0><br><b>".$row["band"]. "</b><br><i>".$row["title"]. "</i></a></td>";
}
}
}
echo "</tr></table><br><table border=0><tr><td colspan=4><img src=images/releases/uprls.gif></td></tr>
<tr>
<td valign=top width=185><a href=><img src=images/covers/100/evr083.jpg height=100 width=100 border=0><br><b>bandname</b><br><i>albumtitle</i></a><br>In stores 09.23.03</td>
<td valign=top width=185><img src= height=100 width=100 border=0></td>
<td valign=top width=185><img src= height=100 width=100 border=0></td>
<td valign=top width=185><img src= height=100 width=100 border=0></td>
</tr>
</table>";
}
I'm trying to have that first row (tr) in the table display the last 4 releases that have passed today. And I'm trying to have the second row (tr) display the releases that haven't yet passed today... does that make sense?
If anyone can help me I would truly appreciate it.
Thank you