SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question multiple conditions in an if statement

    Is this the right way to do it?
    HTML Code:
    <%if rs2("pID")=3 AND rs2("pID")=4   then Response.Write"checked=checked"%> 

  2. #2
    SitePoint Enthusiast
    Join Date
    Jan 2012
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what you probably want is this :

    <%if (rs2("pID")=3 OR rs2("pID")=4) then Response.Write " checked "%>

    rs2("pID") won't have the values of 3 AND 4 at the same time ...

  3. #3
    SitePoint Enthusiast joeyramirez's Avatar
    Join Date
    Nov 2011
    Location
    Cabanatuan City, Philippines
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What if I have rs("pid")=2 AND rs("ticketid")=10001 ?

  4. #4
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by joeyramirez View Post
    What if I have rs("pid")=2 AND rs("ticketid")=10001 ?
    that would be okay to use


Bookmarks

Posting Permissions

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