• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to insert in OneToMany relationship

How to is posible insert in relationship one to many.




Please tell us what you are trying to do, if you just give a schema table without detail explanation we can't help you !

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).

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.