Foreign Key Relationship Issue
Rate Topic:
1 Votes

Hi,
i have a model(media.php) and it has genre checkbox from genre model.While creating media form i am submitting the $model->gener in media model,but genre is not in my DB table .For this i have a mapping table like
mediaId reference from media table and genreId from genre table.

My question is i want to save selected checkbox from model media,insted of saving it to media table i want to save it mapping table media_genre.

genreId is not saved in tbl_Media.But submitted from media.php model and saving genreId direct into tbl_media_genre ,which is my mapping table.genre is my checkBoxList.
I am not sure if this is a right approach or not.