Jump to content

help creating table.


corillo181

Recommended Posts

i have 2 tables

 

artist table

genre table

 

the genre have many different genre and they can be apply to any artist

 

how would i create a array of genre for one artist?

 

like a new table such as genre_to_artist and have a field with artist_id and genre_id('type1','type2','type3') and so on.

 

i guess the main question is how can i do a array field in mysql?

 

or is there a better way to do this?

Link to comment
https://forums.phpfreaks.com/topic/96956-help-creating-table/
Share on other sites

create a third table "artist_genre". Rows contain artistID and genreID with a separate row for each genre that the artist belongs to.

[pre]artist          artist_genre          genre

=========      ============          ===========

artistID  --+  id              +----  genreID

artistName  +-- artistID        |      genre

                genreID    ----+

Link to comment
https://forums.phpfreaks.com/topic/96956-help-creating-table/#findComment-496258
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.