Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If and Then with Database??

    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!!
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #3
    New Coder
    Join Date
    Jan 2003
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you inserting the images into the database, or are they in a folder?
    Only when we die do we realize the importance of life

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, here is the link to the page...

    http://www.ocmotorcars.com/showroom....ate&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!
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Stillwater Ok
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since its a bit, couldn't you use:

    IF NOT rsGuestbook("event_type") THEN
    "Never offend people with style when you can offend them with substance."
    --Sam Brown


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •