Hi All,
I have a script for my image gallery that retrieves an array of image names from a folder. Are there any advantages of having these names of images listed in the database?
Am I better to run my script based on what is stored in a database or should I just retrieve the list from the folder and then store the array in a session variable?
Brad.
Storing reference to images in database?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Personally I like to keep everything stored in a database. Just so I can much more easily manipulate it's data. For instance I only want to get photos inserted from a specific date on. Cannot do that dynamically grabbing your info by checking the folder. This is only one advantage out of many 
I would say database.
I would say database.
Thanks Phenom,
I looked at phpwebgallery and noticed that in their script they upload the images into a folder but they also run a process which stores all the names in the database. As I'm still wrapping my head around PHP, I didn't know if I should be doing the same thing or not. I think I will try and store them in a database though...it might be good practise.
Brad.
I looked at phpwebgallery and noticed that in their script they upload the images into a folder but they also run a process which stores all the names in the database. As I'm still wrapping my head around PHP, I didn't know if I should be doing the same thing or not. I think I will try and store them in a database though...it might be good practise.
Brad.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: