$sql="select category,min(start_date) as start from events where start_date<=now() and (end_date is null or end_date>=now()) group by category order by start_date,category";
$query=@mysql_query($sql);
while($row=mysql_fetch_assoc($query)){
echo "
$sql="select * from events where start_date<=now() and (end_date is null or end_date>=now()) and category='$row[category]' order by start_date";
$query2=@mysql_query($sql);
while($row2=mysql_fetch_assoc($query2)){
$row2["description"]=nl2br($row2["description"]);
$url=$row2["url"];
if (empty($url)) $url="/events/$row2[indexer]";
echo "
} ?>
$row[category]
"; ?>| $row2[start_date] | $row2[title] | $row2[description] |
} ?>