Results 1 to 4 of 4
  1. #1

    Require Assistance

    Hello people,

    I am a complete novice to php/mysql programming and need some help in developing e-commerce based website. My questions are:

    1) IS there a way pictures(preferably *.jps) are inserted/retrived directly from mysql database? If yes then how exactly that works? I need to be able to display images on my webpage by retrieving them directly from the database and allow website adminitrators to insert any new images they have.


    2) Can pictures directly be retrived/replaced/added in the images directory e.g /home/username/images using PHP?

  2. #2
    Join Date
    May 2004
    2) Can pictures directly be retrived/replaced/added in the images directory e.g /home/username/images using PHP?
    Yes. Google has loads of helpful results. Image upload scripts are pretty simple. Seeing as you want to be able to replace them aswell, you would probably need an image management script of some sort. Check out

    As far as 1 goes. I think it is possible, but I'm not sure how.

  3. #3
    It would be great if i knew how would it be possible using mysql instead.... Can someone guide me through.... or atleast show me the right place to put up this question ... Thanks

  4. #4
    Join Date
    Jul 2003
    You need to store two things about the image -- the image data itself (obviously) and the mime-type of the image.

    Then you simply retrieve the data (using commands such as mysql_query and mysql_fetch_assoc). After you have the record from the database, you need to set the correct header for your image type, and echo the image to the browser.

    To call the script, you would use an image tag. For example, <img src="image.php?id=5" alt="my image" />

    That's all there is to it.
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts