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

#1
Exclamation 
How to is posible insert in relationship one to many.

table_movie
-id
-titulo

table_format
-id
-sigla

table_movie_format
-table_movie_id
-table_format_id
Reply

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

#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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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