I have an initial form which inputs data into table 1. After data is entered into table it is displayed on the screen along with a secondary form. The information in this form is to be input into table 2. Upon submitting this form, the info is displyed again with another form to upload files into table 3.
The 2nd and 3rd forms are dynamic and depend on the info from the previous form.
My question is... How do I pull the correct PK from table 1 so that it can be entered as the FK in tables 2 and 3?
Its not too much of a problem if only one person is entering applications, but what if more than one are submitting to the db?
don't know the dbms you are using, but if you are using MySQL which has autoincrement, you could select last_insert_id to get the last generated id and store that in a session... (other dbms usually have something similar)
i would suggest sessions for variables that need to be available on multiple pages... (not only safer but also doesn't require all those values to be transported between client and server...)