1
I have three tables: preco
, estabelecimento
and precoXestabelecimento
. The id
of price is autoincrement
and there is a relationship N:N between the first two tables, which is represented by the third table precoXestabelecimento
.
For a price to be saved you need to have an establishment linked to it, so the moment a price is saved I need to get your ID, along with the establishment ID and save it in the 3rd table. The problem is that I don’t know how to get the price ID once its value is autoincrement
and has not been saved in the database yet.