A database query returns rows of information
Each row contains a part number
I want an anchor around the part number which opens an image called
(partnumber).jpg eg. dr117.jpg
Trouble is, half the part numbers have jpgs and the other half don't
So, if there isn't a file called dr11.jpg I need Cold Fusion to inform this to
the user
Is this possible?
paross1 - 26 Nov 2007 18:51 GMT
You might want to take a look at the http://livedocs.adobe.com/coldfusion/7/htmldocs/00000461.htm function.
Phil
CFMXPrGrmR - 26 Nov 2007 18:52 GMT
Check that there's a value in the image field, if it's blank ignore outputting
the image src tag.
<cfif myQueryName.imgField NEQ "">
<img src="#myQueryName.imgField#" width="imgWidthHere"
height="imgHeightHere">
</cfif>
imgField would be the source name of the image, like dr117.jpg. Is this what
you are looking for?
cf_dev2 - 26 Nov 2007 20:51 GMT
FileExists(..) sounds like what you're looking for.
Dax Trajero - 26 Nov 2007 23:11 GMT
fantastic - is there anything coldfusion CAN'T do ?!?!
cf_dev2 - 26 Nov 2007 23:23 GMT
Wash your car or pick up your dry cleaning ;-)