[PHP] Layout Help

2002-05-10 Thread Jason Soza

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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Layout Help

2002-05-10 Thread David Freeman


  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.

It's really more an sql question than a php question but...

Have a table that contains dates and names of shows.

Have another table that contains artists.

Have another table that contains songs.

Have another table that contains tracks.

Each of these also has an ID in addition to the other data in the table.

Have a linking table that contains artist ID's and song ID's.  This
lets you, for example, look up all songs for a particular artists or,
potentially, all artists for a song.

Have another linking table that contains song ID's and album ID's.  This
lets you relate songs to albums and, through the previous table,
artists.  This way, though, you can have compilation albums with
multiple artists on a single album.

Last of all create another linking table with song ID's and show ID's.
This gets you songs for a show but, through the other linking tables you
get information on everything else.

For any additional information just store it in the relevant table (ie.
If you want to keep track of song lengths then it would go in the songs
table, if you wanted artist bios that would be in the artist table and
so on).

You'll obviously need to be doing a fair number of joins in your queries
but it will give you a more versatile structure.

Then write your php for the interface (oh, the easy bit, and finally
some mention of php, does that make this message on-topic now?)

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php