This topic is locked

get parent record ID for use on child page

2/24/2014 9:29:23 AM
PHPRunner General questions
W
wfcentral author

If I have tbl_parent and tbl_children
tbl_parent

  • id
  • name
  • address
    tbl_children
  • id
  • parent_ID
  • name
  • address
    from the tbl_parent list page I click on the link to add/edit/delete children for this parent
    I have placed some php code on the children list page and I need to get the parent ID added to my php code so I can use it in an external page I'm building.
    I tried pulling it from the initial URL and that worked, however after you add/edit a child record the URL changes to a list page url without any GET variables so then my PHP fails.

Sergey Kornilov admin 2/24/2014

Once you pulled this value from the initial URL save it in session variable and use it on all consecutive pages.