Answer the question
In order to leave comments, you need to log in
How to properly design the database: one user - many galleries - many images?
I want to make the following functionality, I have a user who can create a certain number of galleries (the gallery can have a name, selfnail), a certain number of pictures can be stored in each gallery.
As I imagine it, there is a user(user_id primary) table, when the user creates a gallery, I create a table (gallery_id primary, user_id, gallery_name, gallery_thumb), and when the user uploads images to the gallery, I create another table (img_id primary, gallery_id, img_name).
Is this the right decision? After all for each user 2 tables are created.
Thanks to all!
Answer the question
In order to leave comments, you need to log in
As I imagine it, there is a user(user_id primary) table, when the user creates a gallery, I create a table (gallery_id primary, user_id, gallery_name, gallery_thumb), and when the user uploads images to the gallery, I create another table (img_id primary, gallery_id, img_name)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question