View Full Version : If and Then with Database??

The Wizzard
01-20-2003, 09: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.


01-20-2003, 08: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

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

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


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?


01-22-2003, 08:42 PM
simple answer

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


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

IF NOT rsGuestbook("event_type") THEN