I have a simple database with CD's and songs.
I have a CD base with info about the CD
I have a song base with info about the songs.
And then I have a tracklist base with info about which songs is on which CDs.
I have these codes in my Song file
$gettrack=mysql_query("select * from DiscographyTRACKLIST WHERE `Song`='$idsong'");
while ($row = mysql_fetch_array($gettrack)){
$cd=$row['CD'];
$getlist=mysql_query("select * from DiscographyCD WHERE `CDid`='$cd' LIMIT 1");
while ($row = mysql_fetch_array($getlist)){
$cdid=$row['CDid'];
$cdtitel=$row['Titel'];
$release=$row['Release'];
$year = substr($release, 0, 4);
?><tr>
<td width="200"><div align="right"><?echo $year;}?></div></td>
<td width="300"><a href="DiscographyCD.php?ID=<?echo $cdid;?>"><?echo $cdtitel;?></a></td>
</tr>
<?;};}
This works fine and it lists the CD's that contains the specific song.
But how do I list it in another order. ??
If I put a ORDER BY in the first mysql_query I can't order it by ex. year, since the year info is in the CD base and not in the tracklist base.
And I can't ORDER BY in the second mysql_query since this just gets the info from the one CD the first mysql_query finds.
Is it possible with some codes, or do I have to do it all over, with completelly different coding. ?