Roger Ramjet wrote:Storing the image file in a database table is a waste of time because the image has to be extracted and recreated as a file so that it can be linked to via an HTML <img> tag and served up.
Not entirely true. You can retrieve and display an image without the intermediate step of creating a file. Something like:
<?php
header("content-type: image/jpeg");
// do stuff to open db and get image data into a variable or whatnot here
print $picturedata;
?>
What you should do is to store the image file as a file and just store the name and path in the db. Then you can generate the html to use that file.
I totally agree. The only time to store the image in the database is when you have multiple front-end servers and you need transactional integrity of the image changes along with db data. It's rare, but it happens.