Ok, I'm trying to put together a SELECT query for a record label's shows page.
Table columns are - showid, band, bandfolder, date, day, month, year, venue, bands, details.
The 'band' column is for specific bands on the label and 'bands' is for the general show line-up.
If a few bands from the label are playing the same show, how can this be written so that the show details are only entered into the table once, but the information can be pulled for each INDIVIDUAL band's show page?
I currently need to add a new row for each band on the label if they're playing a show with another band from the label.
And I'm sure there's a better way to construct this table ie. using 'bandfolder' as a lowercase/no spaces field and my date formatting, so any suggestions are more than welcome!
<?
// Shows by showid - Generate and execute query
$query = "SELECT * FROM shows WHERE showid = '$showid'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
echo '<h1>Show details</h1>';
echo '<div id="shows-table">';
echo '<table><tr><th>Date</th><th>Bands</th><th>Venue</th><th>Details</th></tr>';
// Shows by bands - Generate and execute query
$result = mysql_query("SELECT * FROM shows WHERE bandfolder='$band' AND date >= CURDATE() ORDER BY date ASC");
while($send = mysql_fetch_object($result )) {
echo '<tr><td class="table-nowrap">';
echo "$send->day"; echo ' ';
echo "$send->month"; echo '</td><td>';
echo "$send->bands"; echo '</td><td>';
echo "$send->venue"; echo '</td><td>';
echo "$send->details"; echo '</td></tr>';}
echo '</table>';
echo'</div>';
?>