Jason Soza wrote: > Hey all... I really do want to thank everyone for all the help and > advice you give. I know my questions sometimes are probably more > annoying than anything else, but your input really does help. > > Anyway, I have a stack of 76 playlists I need to consolidate and > display. These are from radio shows, so each playlist has the date, the > name of the radio show, and anywhere from 20 - 27 tracks, artists, and > albums on them. > > I know I could simply stick these into a MySQL database using fields > like, date, show, track1, artist1, album1, track2, artist2, album2, > etc. but would that really be efficient and would I be able to use PHP > effectively to retrieve all that information and display it correctly? > > Has anyone out there done a similar project? If so, what was your > approach? Thanks in advance, > > Jason Soza >
Using MySQL or any database for that matter will be most efficient, however, they way you lay it out may not be. You'd want to store tracks individually which would have columns associated with it for example, Artist, title, album, show date, and most importantly the playlist it is associated with. You could have a seperate table for information specific to the playlist, so you don't have to repeat information when you insert songs into the track table, but isn't necessary as long as you maintain some consistency. If you want to get really fancy, then you could have at least 3 tables like the following... A songs table with title, author, album, song_id, where each song title and author combination are unique and only occur once. A playlist table which stores the song_id in the order that is played and the playlist_id, the date of the show and the show_id that the playlist is associated with. and a Show table which stores information specific to the show. with three tabels you will minimize the amount of information that is repeated, since you'd only need to insert a particular song once, and build playlists from that list of songs. The other less sexy option is to use flatfiles. Which wouldn't be pretty straight forward. Just right some information about the playlist at the beginning of the file in a consistent manner and fill it with song titles, one on each line. I think you are on the right track with MySQL though, you just need to break it down to at least more than one table since having 20+ columns that store song names is rather ineeficient. Hope that provides some insight. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php