Welcome Guest, Not a member yet? Register   Sign In
How to insert in OneToMany relationship
#3

You have to insert the data in order to get the ID values required for the tables which manage the relationship(s) between the other tables. In other words, you would insert your data for table_movie and table_format, getting the id value for each after performing the insert, then you would insert those two id values into table_movie_format. If you insert multiple formats for a movie, you would insert the movie and get the id. Then insert a format, get the format's id, insert the two id values into table_movie_format, then repeat for each format (using the same movie id).
Reply


Messages In This Thread
RE: How to insert in OneToMany relationship - by mwhitney - 10-05-2015, 10:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB