If I'm understanding correctly, you have a table w/ a generated unique identifier column and two other tables that will include this unique identifier tying the three tables together. I'm really only familiar with SQL databases, so I'll offer a solution for that and hope it helps.
I'm also assuming the data to populate the 3 tables all comes from one input form. I would use a stored procedure similar to this:
------------------------------------------
create proc test
@input1 varchar(20),
@input2 varchar(20),
@input3 varchar(20),
as
declare @myid int
insert into table1
(columnname)
values
(@input1)
set @myid = @@identity
insert into table2
(table1_ID, columnname)
values
(@myid, @input2)
insert into table3
(table1_id, columnname)
values
(@myid, @input3)
---------------------------------------------
The command line in PHP would be "exec test '$input1','$input2','$input3'"
All this just to say that, in SQL, anyway, the Unique Identifier of a row that was inserted is stored in the variable @@identity. Keep in mind it disappears as soon as any other command is run. This is why I moved it to a local variable, as it would have disappeared before the insert into the 3rd table. Hope this helps.