Skip to main content
Inspiring
February 5, 2009
Question

empty string?

  • February 5, 2009
  • 5 replies
  • 983 views
i have a details page that displays 2-6 thumbnails based on how many exist in the database. When a user mouses over a thumbnail a larger image displays. These images are displayed using cfquery and work Ok. Is there away NOT to display the empty image place holders that are currently display when there is not a thumbnail available. -- thank you
jim
This topic has been closed for replies.

5 replies

Inspiring
February 5, 2009
rockhiker wrote:
> I plan on moving the images to a new table. I still need to learn how not to display the place holders that have no images.

That is the point. If the images where in a new table and you use a
join in your sql query to retrieve them, you only get records that have
images. You *don't* have empty images then.

With a proper, normalized, relational database design you only get
records with images. Some will have two records some will have six, but
none will be empty.

You then use any number of looping algorithms to loop over the number of
images you have and display each one.

Ian
rockhikerAuthor
Inspiring
February 5, 2009
I plan on moving the images to a new table. I still need to learn how not to display the place holders that have no images.
rockhikerAuthor
Inspiring
February 5, 2009
I plan on moving the images to a new table. I still need to learn how not to display the place holders that have no images.
Inspiring
February 5, 2009
Add something to your where clause to exclude records without thumbnails.
rockhikerAuthor
Inspiring
February 5, 2009
i have tried excluding records that do not have thumbnails with no luck.
Each record has two thumbnails that display fine. Some records have 3-6 thumbnails, others have only 2 so if i have a record with two thumbnails in the database i get those two thumbs displayed and four empty image place holders. i do not want to display the empty ones and all where clause options so have not worked.
each thumnbnail below is linked and when moused over display its larger image.

/images/#thumb1#
/images/#thumb2#
/images/#thumb3#
/images/#thumb4#
/images/#thumb5#
/images/#thumb6#

thank you
jim
Inspiring
February 5, 2009
there are several ways, but which one to use will depend on your that
pulls the data from your db...

post your query that gets the images data from db.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
rockhikerAuthor
Inspiring
February 5, 2009
Basic query as follows:

<cfquery name="featured" datasource="projects">
SELECT * from completeProjectsRecent
WHERE featured= yes
</cfquery>