I need to do an insert as follows:
I have two tables TABELA 1
and TABELA 2
and a form of cadatro.
This form has three inputs: input 1, input 2, input 3
input 1
must be entered in TABELA 1
.
input 2 e input 3
need to be entered in TABELA 2
However, TABELA 2
has a foreign key field of TABELA 1
which is the foreign key of input 1
.
I need to make that when doing the submit
of the form the fields are written to the tables and the foreign key field of TABELA 2
receives the ID of the new insert that was made in TABELA 1
.