...

View Full Version : If and Then with Database??



The Wizzard
01-20-2003, 08:55 AM
Hey Everyone...

I have a database with car listings in it. Now, what i want to do is, if there is a picture of the car, simply put "Yes" or "No" in a text field.

If it says "Yes" then display the little icon of the camera, if "No" then dont display the camera...

I hope my explanation was clear enough.

Thanks!!

whammy
01-20-2003, 07:02 PM
I would just use a bit field... 0 or 1.

If it's 1 display a camera.

Easy enough to do, but how are you determining whether there is a picture? I'd just go by that, why be redunant

Esona
01-20-2003, 07:31 PM
Are you inserting the images into the database, or are they in a folder?

The Wizzard
01-22-2003, 07:31 PM
Well, here is the link to the page...

http://www.ocmotorcars.com/showroom.asp?tab=1&sortby=InsertDate&order=desc

If you notice, all the cars have a little camera icon next to them. Some of the cars have "Stock" photos, and so if they have a stock photo, i would like to have no camera icon show up.

Does this make sence?

Thanks!

scroots
01-22-2003, 07:42 PM
simple answer

IF rsGuestbook("event_type") = 0 THEN
response.write("<img border=""0"" src=""clear.gif"" align=""middle"" width=""20"" height=""30"">")
END IF

scroots

Eskimo
01-22-2003, 08:08 PM
Since its a bit, couldn't you use:

IF NOT rsGuestbook("event_type") THEN



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum