OK, when I changed the code to:
PHP Code:
$sql = "SELECT id, aid FROM bands, albums WHERE band='$band' and album='$album_name'";
$result = mysql_query($sql);
$id and $aid = mysql_result($result, 0);
$result = mysql_query("select songs.song_id,songs.song_name,songs.song_lyric,albums.aid
from songs as songs,albums as albums where songs.song_id = albums.aid
and songs.song_id = '$aid' order by songs.id")
Now I can see the title of the album ($song_name), it just needs to list the songs under the album.
I use this code to list the songs:
PHP Code:
$num=mysql_num_rows($result);
for($i=1;$i<=$num;)
{
while ($row = mysql_fetch_array($result))
{
$song_name=$row['song_name'];
$song_lyric=$row['song_lyric'];
echo stripslashes("<tr><td width=\"6%\" align=\"center\">$i.</td><td><a href=\"$PHP_SELF/lyrics/$band/$album_name/song_name/\">$song_name</a></td></tr>");
$i++;
}
}
Can anyone see if I'm missing something? I'm so close now.
Bookmarks