Hi:
I'm working on a musician website , who has many albums and songs. Many songs appear in many albums, for example "Greatest Hits"
To manage that I have created 3 tables: albums, songs, songs_albums.
Albums has all the Album info like: title, year released, etc....
Songs has all the songs info like: title, length, lyrics...
songs_albums is where the relationship between albums and songs defined.
It has albumid, songid, displayOrder
I can successfully retrieve and display all the songs for 1 album with a statement like this:
SELECT * FROM `songs_albums` join albums ON (albums.albumid=songs_albums.albumid)
join songs ON (songs.songid=songs_albums.songid)
WHERE songs_albums.albumid=4
The #4 is dynamically passed.
So now we need a new page, where I have to display each the Album titles, with corresponding songs.
{from this point I'm lost}
If I remove the WHERE clause, I get multiple album titles....
Do I have to run a query within the query? Should I use DISTINCT?
please help.....