Answer the question
In order to leave comments, you need to log in
How to correctly form links between a table with a photo and with regions?
Hello, please tell me the best way to do this. I have a table in the "regions" database, in which various information about the regions is stored there, it is necessary that these regions have photos, there can be many photos for each region. Actually what is the best way to make a connection? Many-to-many? Will there be an intermediate table in the end where the id of the region and the id of the photos will be compared?
Answer the question
In order to leave comments, you need to log in
If you have a single table with all the images in the project, then many-to-many is a separate table.
If you have a separate table with images for regions, then enter the region_id field in it and link it. (it is important to understand that it is unlikely that you use one photo for several regions)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question