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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Posts
    456
    Thanks
    0
    Thanked 20 Times in 20 Posts

    simple comparison problem

    if($Item==0 || $Listing_Page < 2){
    //--- Show Items Here ---//
    }

    Am I missing something? In my script, this simple comparison only returns the left side and totally ignores the right. I thought it was like javascript where if this ||that are true then show the items. It only seems to check left side, but I'm sure I used these before...
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,602
    Thanks
    78
    Thanked 4,387 Times in 4,352 Posts
    Easy way to check: Turn it around.
    Code:
    if($Listing_Page < 2 || $Item ==0){
    Better way to check: DEBUG DEBUG DEBUG!
    Code:
    echo "DEBUG: Item is $Item and Listing_Page is $Listing_Page<hr/>\n";
    if($Item==0 || $Listing_Page < 2){
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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