0
I have a table in my database called imoveis
where I have some columns, standing out localizacao_fk
and correspondencia_fk
, both foreign keys that reference the table enderecos
. What I want to know is how to insert data into the table imoveis
so that the stand of the columns localizacao_fk
and correspondencia_fk
automatically be done in the table enderecos
.
An overview of what I intend to do is as follows:
I have a registration form where, at a certain point, I have fields of two types of addresses to be filled: the primary (referring to the column localizacao_fk
) and high school (correspondencia_fk
). But in the bank, fields of this form as zip code, street, neighborhood and city are not in the table imoveis
, and yes in enderecos
. Therefore, the filling of such fields would populate both localizacao_fk
how much correspondencia_fk
(if I wish to provide this secondary address).
Help!
Here are the prints of the tables:
Could post your tables.
– Marco Souza
I already made the links available in the post.
– Laercio Monteiro