i hav inserted a image into mysql via php using blob data type ? i need to view tat image in php how is possible ? if i print its displayin lik byte code ?pls help me
Here’s a really good tutorial/example of what you’re looking for.
One more thing on images and MySQL. They cause a lot of overhead for the server.
The image must be streamed out as headers and data. This causes a lot of work for the
server if you end up with a lot of images.
It is better to just store the location of the image in the server. That would be a simple text
entry and point to a folder and name of image on the server. Then, in the display page where
the image needs to be viewed, just use the URL to the image instead. Let the browser just
load the image as you normally would. Use PHP to store the IMG source in the page. Works
much better and faster that way. Cuts down on server overhead if a lot of images are needed.