This currently pulls up a table showing the albums listed under the artist clicked on the previous pages links.
What I want is another column showing all the tracks on corresponding album
Table set up
table (artist) art_id - art_name
table (album) alb_id - alb_name - alb_year - alb_label - alb_img
table (track) track_id - track_title - track_time - track_extra
table (aarelations//artist-album relation) aarel_id - relatedart_id - relatedalb_id
table (atrelation//album-track relation) atrel_id - relatedalb_id - relatedtrack_id
include('../incl/connect.php');
$row['art_id']= $_GET['art_id'];
$result = mysql_query("SELECT DISTINCT album.*, artist.* FROM album, artist, aarelations WHERE artist.art_id = aarelations.relatedart_id AND album.alb_id = aarelations.relatedalb_id AND artist.art_id='$id' ORDER BY alb_year ASC");
echo mysql_error();
if (mysql_num_rows($result))
while($row = mysql_fetch_array($result)) {
$imagelink = $row['alb_img'];
echo "<div align=center>";
echo "<table width=100% class=outside>";
echo "<tr>";
echo "<td align=left>" . $row['alb_name'] . " <br/>(" . $row['alb_year'] . ")<br/><img src=$imagelink><br/><b>" . $row['alb_label'] . "</b></td>";
echo "<td align=left>" .
<b>[B]Here is where I want track info[/B]
[list]
[*]track 1
[*]track 2
[*]track 3
[/list] </b></font></td>";
echo "</tr>";
echo "</table>";
echo "</div>";
}
Not sure how to query that all in one, use a join... and if a join how (or lead me to some examples, searched but had little finding something dealing with a table layout).
Thanks ahead of time 🙂