Hey guys!.I'm working on a project and I kinda need help.I'm stuck trying to design a database that will let users upload their images and retrieve it in a gallery assigned to each user without conflict.
In my script the users can add a gallery by specifying a name, then in trying to make the gallery name unique I assigned a $_SESSION['username'] variable to the name of the table to be created.
My problem now is trying to retrieve the images from each users table and display in lets say for a profile picture.Maybe I'm thinking of the problem logically, but any help will be appreciated.Thanks guys
Managing uploaded images
Started by farouqzaib, Aug 26 2009 05:51 AM
3 replies to this topic
#1
Posted 26 August 2009 - 05:51 AM
|
|
|
#2
Posted 26 August 2009 - 07:11 AM
I think you're approaching it wrong. I would create a single table to store all galleries.
Have fields "username", "galleryname", "filename", "fileblob". Then you can return the records where "username"='blah' and "galleryname"='blah'.
Have fields "username", "galleryname", "filename", "fileblob". Then you can return the records where "username"='blah' and "galleryname"='blah'.
#3
Posted 03 September 2009 - 06:16 AM
If the problem is how to pull the images once they're uploaded, try putting all images in a single folder somewhere on the server. Then, on a database, add the directory of each image and what gallery it should be in. Then, when a user logs on, you can run a basic query to pull the directory of whatever his or her profile picture is and pull it from the folder. The same can be done for all images in a certain gallery.
#4
Posted 04 September 2009 - 07:50 AM
Thanks guys, I'm just a database buff, wanna keep everything in the database


Sign In
Create Account

Back to top









