Pulling and adding images to mysql

Discussion in 'Programming' started by Kurt Whittingham, May 7, 2012.

  1. #1
    Hello. i need to know how to add images into my MySQL database or have them in another place and be able to pull them onto a query?

    Thanks
     
    Kurt Whittingham, May 7, 2012 IP
  2. CodeBeast

    CodeBeast Well-Known Member

    Messages:
    463
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    155
    #2
    You can save a random unique string,into the database and everytime when someone wants to access the image he will get a link like:
    www.yourwebsite.com/gallery/randomstringHere/
    Also you can save the image unique name into the db.

    I'm not sure if it will work,It was just a quick tough.

    Hope it helps somehow.
     
    CodeBeast, May 7, 2012 IP
  3. Arttu

    Arttu Member

    Messages:
    139
    Likes Received:
    2
    Best Answers:
    8
    Trophy Points:
    40
    #3
    It is possible, but I don't see why you wouldn't just store the image's name in mysql and the image itself as file. Storing the images in mysql would use much more server resources.
     
    Arttu, May 8, 2012 IP
  4. Kurt Whittingham

    Kurt Whittingham Member

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #4
    If i put the url of the image into the data base would it show on the page?
     
    Kurt Whittingham, May 10, 2012 IP
  5. Kurt Whittingham

    Kurt Whittingham Member

    Messages:
    151
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #5
    how do i get the image to show tho?
     
    Kurt Whittingham, May 12, 2012 IP