help with query, can't get my head around it
Posted: Mon Apr 14, 2008 10:07 pm
Hey everybody,
so i am building a site for a drum company. they want to be able to list shows from the artists they sponsor and group them acordingly (this site is all dynamic btw).
so i have a shows table and an artists table. When you go to add a new show you relate the show to the artist like so
simply, it loops through and gets all the artists and outputs them in a select so that the show can be related to an artist. My problem is, how can i build a loop that will display all the shows but also add in the band who's playing the show only once... That may be hard to understand so i will show you
ARTIST
-show
-show
-show
-show
ANOTHER ARTIST
-show
-show
-show
does that make sence? any suggestions? need any information just ask. Thanks in advance!
so i am building a site for a drum company. they want to be able to list shows from the artists they sponsor and group them acordingly (this site is all dynamic btw).
so i have a shows table and an artists table. When you go to add a new show you relate the show to the artist like so
Code: Select all
<select name="artist">
<?php
$query = "SELECT artist FROM ida_artists ORDER BY artist ASC";
$mysql = mysql_query($query);
while($d = mysql_fetch_assoc($mysql)):
print '<option>'.$d['artist'].'</option>';
endwhile;
?>
</select>
ARTIST
-show
-show
-show
-show
ANOTHER ARTIST
-show
-show
-show
does that make sence? any suggestions? need any information just ask. Thanks in advance!