rockhiker
2009-02-24 00:50:05 UTC
I am trying to display anywhere from 1- 7 thumbnails that may or may not be
available. The filename for each thumb is stored in the database. All i get is
a placeholder instead of an image. I only want to display the image if a
filename exists for it in the database. If it does not exist in the database ,
I do not want to display anything! (image place holder for example). Please see
code-- I am novice but getting better - thanks to this forum.
<!---seems to work -a list of projects is generated by passing values in a
hotspot's url--->
<cfquery name="cool" datasource="projects">
SELECT endDate, region, county, countyID, roadname, bmp, emp, proj, estcost,
authfunds, paid, narrative, software, image1, image2, image3, image4, image5,
image6, image7, thumb1, thumb2, thumb3, thumb4, thumb5, thumb6, thumb7
FROM completeTest, completeImagesRecent
WHERE completeTest.projectID=completeImagesRecent.projectID
</cfquery>
<!--- this query is used to pass values to the project details page when a
user clicks on a project-- it works--->
<cfquery name="cool" datasource="projects">
SELECT * FROM completeTest,completeImagesRecent
where countyid=#url.countyid#
and completeTest.projectID=completeImagesRecent.projectID
</cfquery>
<!--- finally this code displays six image place holders an no images but does
not generate an error--->
<cfoutput>
<cfif #thumb1# EQ " " >
<cfelse>
</cfif>
<img src="#thumb1#" /><br />
<cfif #thumb2# EQ " " >
<cfelse>
</cfif>
<img src="#thumb2#" /><br />
<cfif #thumb3# EQ " ">
<cfelse>
</cfif>
<img src="#thumb3#" /><br />
<cfif #thumb4# EQ " ">
<cfelse>
</cfif>
<img src="#thumb4#" /><br />
<cfif #thumb5# EQ " ">
<cfelse>
</cfif>
<img src="#thumb5#" /><br />
<cfif #thumb6# EQ " ">
<cfelse>
</cfif>
<img src="#thumb6#" /><br />
</cfoutput>
available. The filename for each thumb is stored in the database. All i get is
a placeholder instead of an image. I only want to display the image if a
filename exists for it in the database. If it does not exist in the database ,
I do not want to display anything! (image place holder for example). Please see
code-- I am novice but getting better - thanks to this forum.
<!---seems to work -a list of projects is generated by passing values in a
hotspot's url--->
<cfquery name="cool" datasource="projects">
SELECT endDate, region, county, countyID, roadname, bmp, emp, proj, estcost,
authfunds, paid, narrative, software, image1, image2, image3, image4, image5,
image6, image7, thumb1, thumb2, thumb3, thumb4, thumb5, thumb6, thumb7
FROM completeTest, completeImagesRecent
WHERE completeTest.projectID=completeImagesRecent.projectID
</cfquery>
<!--- this query is used to pass values to the project details page when a
user clicks on a project-- it works--->
<cfquery name="cool" datasource="projects">
SELECT * FROM completeTest,completeImagesRecent
where countyid=#url.countyid#
and completeTest.projectID=completeImagesRecent.projectID
</cfquery>
<!--- finally this code displays six image place holders an no images but does
not generate an error--->
<cfoutput>
<cfif #thumb1# EQ " " >
<cfelse>
</cfif>
<img src="#thumb1#" /><br />
<cfif #thumb2# EQ " " >
<cfelse>
</cfif>
<img src="#thumb2#" /><br />
<cfif #thumb3# EQ " ">
<cfelse>
</cfif>
<img src="#thumb3#" /><br />
<cfif #thumb4# EQ " ">
<cfelse>
</cfif>
<img src="#thumb4#" /><br />
<cfif #thumb5# EQ " ">
<cfelse>
</cfif>
<img src="#thumb5#" /><br />
<cfif #thumb6# EQ " ">
<cfelse>
</cfif>
<img src="#thumb6#" /><br />
</cfoutput>