Quote:
Originally Posted by Killswitch
Oh, I thought you ment grouping them together like Leenks does, or Evilhumor.com
Anybody have any idea on how they go about that?
|
Here's how I did it basically, removed all the html to make it look more simple but it should still print out fine:
Quote:
<?php
$result=mysql_query("SELECT *, from_unixtime(time,'%Y-%m-%d') as date FROM songs GROUP BY time ORDER BY date DESC, views DESC");
while($row=mysql_fetch_array($result))
{
if(!$date)
{
$date=date("l F j",$row[time]);
?>
<b><?=$date?></b><br>
<?=$row[artists]?> - <?=$row[title]?><br>
<?php
}
elseif(date("l F j",$row[time])==$date)
{
?>
<?=$row[artists]?> - <?=$row[title]?><br>
<?php
}
elseif(date("l F j",$row[time])!=$date)
{
$date=date("l F j",$row[time]);
?>
<b><?=$date?></b><br>
<?=$row[artists]?> - <?=$row[title]?><br>
<?php
}
}
?>
|