Jump to content

Making an image gallery with database


silverglade

Recommended Posts

Hi, I want to make an image gallery from user submitted images to and from the database. The thing is, I don't want to look at a tutorial to do it. I want to come up with it from scratch (pseudocode). The problem is, I can't find anything in the "files" section of my books, neither is it in the "database" sections, and it doesn't seem to give me any clue of how to do that sort of thing. I have "PHP5 and MYSQL Bible" kind outdated but good, and "PHP in a nutshell" great, and "php for dummies", decent.

 

Does anyone know what I would look under to learn how to store images in a database and then output them from the database onto a page? Ideally I would store them in an array and loop the array contents out. I don't know. Any help greatly appreciated.

Link to comment
Share on other sites

Think about how you store images now (for use in plain HTML) for use in a web page. Doing it in PHP is not going to be any different, you just need to make PHP generate that same HTML for you.

 

If however you would like to extend this idea somewhat and have comments for the images for instance, then you might use a database to link the images to a comment. How would you do that? You need to store some sort of reference to the image in the database, what reference do you have? A file system path.

Link to comment
Share on other sites

Thank you for that. I will read more about using files and directories then. And figure out how to store an image's path in a database, then extracting that to print out img src's. I think I mainly have a creative thinking problem. Not necessarily a not knowing problem. The books give you the pieces of a puzzle I think, it is up to me to learn to put the pieces together in different ways. I will go back to my books. Thanks Thorpe. :) :) :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.