Initially i added full source code for viewer. but it has some format problem and all the code was messed with HTML format. So now i am asking step by step.
1) I uploaded an image file to my MySQL database. (it has no error, i.e. loaded successfully)
2) Fetching it back to the browser from MySQL Database. It has also no problem(in some condition)
a) It is printing OK if i am printing it before the HTML Tag.
b) I am not able to see any basic HTML design after printing image on browser.
c) If i am printing it inside html tag. It is showing some special characters and numbers, i.e. value which we see in phpmyadmin if we execute the query (select image from pix;)
So, Can any one help me to print image by fetching the image from MySql database?
Or can any one convert this database saved image from MySQL into real image to store into hard-disk back to see/edit it?
You are making a fundamental mistake here. An image resource is always stored and requested in a separate file, not in the HTML source code of the page you want to embed it in.
Such a separate file could be named, say,
getimage.php.It would fetch the image data from the database (e.g. from the record with the ID 890) and output it like e.g. so:
In the HTML page, you would embed it using
There is the theoretical possibility to have image data directly in the HTML source but that’s not what you want.