Jump to content

Managing uploaded images

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
farouqzaib

farouqzaib

    Newbie

  • Members
  • Pip
  • 3 posts
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

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
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'.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Greelmo

Greelmo

    Newbie

  • Members
  • Pip
  • 6 posts
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
farouqzaib

farouqzaib

    Newbie

  • Members
  • Pip
  • 3 posts
Thanks guys, I'm just a database buff, wanna keep everything in the database