Re: database table layout help
| From: | David Robley | Date: | Tue, 16 Apr 2002 05:26:53 +0000 |
| Subject: | Re: database table layout help | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18531@lists.php.net to get a copy of this message | ||
In article <php.db-18521@news.php.net>, webmaster@musicinfo.ath.cx
says...
> I am setting up a music info site and have decided on the follow tables
> ( not to sure weather to add the mp3 part). The one main question I have
> before starting to make the tables is weather mysql_insert_id() would be
> able to handle this with the way I have it ?
> :Artist
> id
> artist_name
>
> :Album
> id - auto-inc
> artist_id
> album_name
> rec_id
> image_id
>
> :Songs
> id - auto-inc
> album_id
> genre_id
> mp3_id
> lyrics
>
> :Genre
> id - auto-inc
> genre
>
> :Recording
> id - auto-inc
> recording_studio
> date
>
> :Album Image
> id - auto-inc
> image
>
> :Artist Info
> id - auto-inc
> info
>
> :Mp3
> id - auto-inc
> mp3_location
>
> Any other suggestions are welcome.
>
> B.J.Rumsey
In answer to your specific question, yes, mysql_insert_id will work for
you as you have auto-increment fileds on each table.
In passing, you could probably combine your artist and artist_info into
one table - assuming there will only be one 'info' for each artist.
Similarly, album and album_image could be combined.
I don't see a song title field? Is that deliberate, or did you miss that
(or am I blind?)
--
David Robley
Temporary Kiwi!
Quod subigo farinam