We have an extensive list of tour dates on our website. I would like to have php/mysql look at the table for each artist and only show content for the ones that have dates listed.
Each artist has their own table, and the table has three columns (show_date, city, venue). Example artist...
<?
$color1 = "#151515";
$color2 = "#252525";
$row_count = 0;
$db = mysql_connect("localhost", "", "");
mysql_select_db("tour",$db);
$sql="SELECT * FROM mastodon WHERE show_date>=CURRENT_DATE() ORDER BY show_date";
$result=mysql_query($sql,$db);
$num = mysql_num_rows($result);
$cur = 1;
echo "<p><center><img src=\"http://www.relapse.com/artist_logos/mastodon.gif\" width=250 height=150 border=0></center>
<table border=0 cellpadding=2 cellspacing=0 width=70% class=table_border>
<tr><td width=33%><font class=header> Date</td>
<td width=33%><font class=header> City</td>
<td width=33%><font class=header> Venue</td></tr>
<tr><td colspan=3><table border=0 cellpadding=4 cellspacing=0 width=100% bgcolor=000000>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$date = $row["show_date"];
$city = $row["city"];
$venue = $row["venue"];
$row_color = ($row_count % 2) ? $color1 : $color2;
echo "<tr bgcolor=$row_color><td width=33%><font class=info>".date("F j",strtotime($date))."</td>
<td width=33%><font class=info>$city</td>
<td width=33%><font class=info>$venue</td></tr>";
$cur++;
$row_count++;
}
echo "</table></td></tr></table>";
?>
Any help is greatly appreciated!
Rick