Re: Best way to store songs in sql db
| From: | Daniel Gustafsson | Date: | Thu, 06 Jul 2000 13:27:12 +0000 |
| Subject: | Re: Best way to store songs in sql db | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5210@lists.php.net to get a copy of this message | ||
At 06:15 AM 7/6/00 -0700, you wrote:
>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?
Now THIS is what exactly what relational databases is all about. Ehrm,
well.. atleast to my knowledge, but don't slap me if I'm wrong. =)
You should store all your albums in one table, and all your tracks in another.
For each album, and each track you have a unique id (which should never be
touched by you, they are set automatically by the database when you insert
a new entry) and each track should also contain the id of which album it
belongs to.
You should probably try sniffing out some material on how to structure a
database, there are plenty of small books (reading a 300 page book is
hardly an option for the beginner) and articles on the net.