SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    storing and retrieving blobs in mysql database table

    I was able to adapt some code to search for a image in a file and insert it into a table but when I wrote a query for the php script it executed and the image was returned as ?? code and not the actual image.

    I am new at this but thought I should be able to find some info online. I did find some suggestion about changing the settings in the .ini file but I don't think that is the issue.

    As if not too obvious I am new at all of this and any help would be appreciated.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    if you are new at all of this, take the easier route and store your images on the file system, not in the database

    in the database, store the path to the image in a VARCHAR column
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That sounds like good advice, but I have read the arguments for storing blobs vs. pointers and am sold on storing blobs. It would be easier to query update, upkeep, and capable of storing a lot more with less effect on processing time,
    at least that is what I came away with, but please correct me if I am wrong.

    I am willing to spend considerable time to learn how to make this happen, just looking for some advice on how.

    Thanks,
    jt

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    in that case i suggest that you ask the moderators (via the little red flag under your avatar) to move this thread to the appropriate language forum -- php, or whatever

    because that's where all the "make it happen" advice is going to come from
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One of the things to remember with blob storage of images is that displaying them needs to be done via headers. SO when you want to show multiple images on a page you will need to make an 'auxillary' file to render the image, which file is called from the "displaying" file.


Bookmarks

Posting Permissions

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