Originally posted by Weedpacket
...What <html> section?
Image files and HTML files are two different things; if you're sending an image you set the header() as you're doing, and then send the image data. There is no "<html> section".
If you're sending an HTML page, the headers don't need to be changed, but you don't send any image data - instead you send <img> tags with src attributes.
An HTML page that displays an image needs to make two requests to the server and get back two separate responses - one for the HTML page itself and one for the image specified in the <img> tag. Are you trying to send both together?
Yes. I am trying to display both the image from the blob field and the records in the other fields (such as name, description etc). And here is the trouble, as i receive the records (name, description etc) normally, and the image i received as the scrambled text.
This is a topic i havent seen been discussed on this forum either other forums. When it comes about image management with php and mysql, people says its better to store in the database only the path and the name of the image file, for database optimisation and performance issues. Well, my database wont store lots of images, so i want to take into consideration the other option: storing it in a blob field. I have done the upload operation, but the problem is displaying the data, more specifically, to display the blob field image along with the data in other fields (the display of the blob field image alone worked).
The reason i posted this topic is to save me some time (i have done the image management operation by storing only the path&name of the image), but also for my curiosity, as i did not see a similar article on the web.
So, "can this be done in php?" 🙂
Cheers,
Catalin