To get the id value from parent table to child table

Hi
Im using 5 tables and one parent table and 4 child tables

To get the id value from parent table to child table.To store the values
in
databases and display the bugs

parent table id is compare to child table is resortid
code
using save page

@resort_contact.resortid=@resort_basic.id
child table id=parent table id

To give any idea and any link
Thanks