corillo181 Posted March 19, 2008 Share Posted March 19, 2008 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 More sharing options...
Barand Posted March 19, 2008 Share Posted March 19, 2008 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 More sharing options...
corillo181 Posted March 19, 2008 Author Share Posted March 19, 2008 ok i did just my problem was when i wanted to update the artist_genre table.. but now i thought about how to make it work and i came up with something.. thank you for the help. Link to comment https://forums.phpfreaks.com/topic/96956-help-creating-table/#findComment-496266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.