Multiple values one mysql field
2 answers
You are looking for join table :
albumsong
album -> FOREIGN KEY to album
song -> FOREIGN KEY to song
tracknumber
Then join the request:
SELECT song.*, albumsong.tracknumber
FROM albumsong
JOIN song ON song.id=albumsong.song
WHERE albumsong.album=(some album id)
ORDER BY tracknumber;
Since some albums are collaborators, you can also have many, many artist / album relationships:
artistalbum
artist -> FOREIGN KEY to artist
album -> FOREIGN KEY to album
+4
a source to share