Hello everyone!
I'm trying to insert AgencyID, LocationID and LocationName into one table
$sql="INSERT INTO Agency_Location
(AgencyID, LocationID, LocationName)
VALUES('$AgencyID', '$LocationID', '$LocationName)";
and trying to insert AgencyID, AgencyEmail, AgencyPhone into another table
$sql="INSERT INTO Agency
(AgencyID, AgencyEmail, AgencyPhone)
VALUES('$AgencyID', '$AgencyEmail', '$AgencyPhone')";
This information is entered into one form.
My problem is that AgencyID has to be entered into the Agency table (where it is the primary key) before I can put the AgencyID into the Agency_Location table. How can I make the program wait for it to be inserted into the first table (agency) before I grab the info. from that table for the Agency_Location table?
Thanks for your help everyone!