Database Structure For "Bookmarking" Photos
Posted: Sat May 20, 2006 9:54 pm
I have a photo database and I want my users to be able to save their favorite photos in custom folders. At the moment, I am not limiting how many folders they would be able to create nor the number of photos they can store in each folder.
My questions is how would you recommend that I set up the database? I have created a user database that stores their id, folder name, and photo ids. I have come up with two ways to organize it.
1. Store each individual photo id as an individual record. Example (1) This would end up creating a very large database overtime though it would be very easy to query to display photos becaue the photo id field would match exactly with the photo database.
2. Store an array of photo ids for each folder. Example woudl be (1, 2, 3, 4, 5, 6, 7). This would reduce the number of records, but I do not know of an easy way to query the photo database to retrieve their favorites because the exact information does not match the field. So I would have to figure a way to pull out the array and then query for each individual record. Is there a way to do this easily?
Would you recommend either of these approaches? If not, how would you set it up?
Any insight would be appreciated.
My questions is how would you recommend that I set up the database? I have created a user database that stores their id, folder name, and photo ids. I have come up with two ways to organize it.
1. Store each individual photo id as an individual record. Example (1) This would end up creating a very large database overtime though it would be very easy to query to display photos becaue the photo id field would match exactly with the photo database.
2. Store an array of photo ids for each folder. Example woudl be (1, 2, 3, 4, 5, 6, 7). This would reduce the number of records, but I do not know of an easy way to query the photo database to retrieve their favorites because the exact information does not match the field. So I would have to figure a way to pull out the array and then query for each individual record. Is there a way to do this easily?
Would you recommend either of these approaches? If not, how would you set it up?
Any insight would be appreciated.