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.

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

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.


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

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.