Best way to store songs in sql db
| From: | Fates | Date: | Thu, 06 Jul 2000 13:15:31 +0000 |
| Subject: | Best way to store songs in sql db | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5208@lists.php.net to get a copy of this message | ||
What is the best way to store songs or tracks in a music SQL database?
Currently, I am using the following database structure:
table: musictable
ID
album
band
genre
album_cover
song1 varchar (50)
song2 varchar (50)
song3 varchar (50)
song4 varchar (50)
song5 etc...
There must be a better way than this?
I was thinking of breaking the table up into two tables. One table contains just songs and album and
the other table contains genre, album, and band.
Another problem I encountered is printing out the tracks. If song4 and higher are empty, then I
don't need to print them. How do I prevent printing empty fields? I probably just need a loop
and if statement.
I use MySQL with Linux and PHP 3.0.16