I’m new to php/mysql
I planning to make a project which may have many users. One part of the project is that users have multiple, even hundreds, of pictures to their name. I was wondering how I should set up the tables for this. Should I do one image table that has all users and all their photos on it such as…
IMAGES
| user | imageID |
| dan | 20030492 |
| dan | 12344942 |
| dan | 22344442 |
| dan | 78998492 |
| dan | 78998992 |
| bob | 25674562 |
| bob | 26574492 |
| bob | 25675672 |
| bob | 67003092 |
or should I have a database for each user such as …
user_images
| imageID |
|---|
| 20030492 |
| 12344942 |
| 22344442 |
| 78998492 |
| 78998992 |
| 25674562 |
| 26574492 |
| 25675672 |
| 67003092 |
of course these aren’t the only columns that are going to be in the table. right now I have 5.
I was thinking that the first option may get too hectic if I have hundreds of users and then hundreds of photos for each. but then again I don’t know if the second option is smart to do.