This SHOULD be easy? If OR

Discussion in 'PHP' started by fireflyproject, Jun 24, 2008.

  1. #1
    Mind debugging this line for me?

    Thanks!

    if ($_GET['page_id'] == 12 OR $_GET['page_id'] == 19 OR $_GET['page_id'] == 20) {
    PHP:
    I don't see anything wrong with it. I'd also tried using || instead of OR (|| is my usual)
     
    fireflyproject, Jun 24, 2008 IP
  2. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #2
    NEVERMIND! I figured it out. I was trying to print things inside the if statement that didn't exist.
     
    fireflyproject, Jun 24, 2008 IP
  3. dannet

    dannet Well-Known Member

    Messages:
    864
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    153
    #3
    You could try adding "()":

    if (($_GET['page_id'] == 12) OR ($_GET['page_id'] == 19) OR ($_GET['page_id'] == 20)) {
    ...
    }
    PHP:
    Good luck
     
    dannet, Jun 24, 2008 IP
  4. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Thanks, I'll keep that in mind for future reference, that might help keep things a bit more organized.

    It ended up being that I was trying to print the children pages of a page that didn't exist. Once I solved that issue, they all showed just like they should!
     
    fireflyproject, Jun 24, 2008 IP