Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditionally display images?

Status
Not open for further replies.

mcpeekj

Vendor
Sep 21, 2001
105
i've got an automotive site, and i have images of most of the cars, but not all. i want to be able to display a little camera image when we have an image in the db. unfortunately, in the image column in the db, i have a nophoto.jpg to display when we don't have an actual picture, so i can't connect to that. so, i was wondering if i could check to see if the contents of the image column contain anything BUT nophoto.jpg, then it displays the camera image. any ideas?
 
you actully wouldn't even need noimage.jpg... you could just hard code no image in. This would save space in your database. You could do this by doing something like this:
Code:
If rs(&quot;image_table&quot;) <> &quot;&quot; then
  Response.Write &quot;<img src='&quot; & rs(&quot;image_table&quot;) & &quot;'>&quot;
    Else
 Response.Write &quot;<img src='nophoto.jpg'>&quot;
End If
www.vzio.com
ASP WEB DEVELOPMENT



 
sorry, i don't think i explained it well enough. i have a page that lists the inventory. on that page, i just want to indicate if there is an image in the db. if not, i don't want it to display anything.
i think i will take you up on that for the individual vehicle detail page though.
 
It would be the same thing. In the cell that you show the small image.. just check in that record to see if there is an image of the car (whichever table that is) then if there is an image then put the little camera image there.
Code:
'# If the big_image table is NOT empty then show small camera..

 If NOT rs(&quot;big_image&quot;) = &quot;&quot; then
   Response.Write &quot;<img src='small_camera.gif'>&quot;
 End If
www.vzio.com
ASP WEB DEVELOPMENT



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top