I do this with several sites. I usually have a field in a table for the image file name (image1.jpg, for example). Then I make sure all of the images are in a specific folder (ImageFolder, for example). Then in my cfquery, I have it select the image name from the table, and I have it output into a html image tag.
Example:
[color maroon]
<CFQUERY datasource="MYDSN" NAME="GetDocs">
SELECT Record1, Record2, Record3, Image
FROM tbl1
</CFQUERY>
This would output in the HTML as:
<img src="whateverdirectory/ImageFolder/image1.jpg>
Or, if you didn't want to have all of the images in the same folder, you could store part of the image path (ImageFolder/image1.jpg, for example) in the database and use it like this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.