Hello and welcome to our community! Is this your first visit?
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
    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
    For projects using MediaTypes (MIMETypes) visit E-BAM.net -(updated weekly)

    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,843 Times in 4,804 Posts
    Easy way to check: Turn it around.
    if($Listing_Page < 2 || $Item ==0){
    Better way to check: DEBUG DEBUG DEBUG!
    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