Jump to content

if statement woes


envexlabs

Recommended Posts

Hello,

 

I am having problems with my elseif statment.

 

$c = 10 and $count_nonum = 24

 

Even though $c (24) is = lessthan (>) $count_nonum ($24) is still moves onto the else statment.

 

am i overlooking some minut detail, or is something wrong?

 

    //creates the next and previous buttons to only show 10 messages
    if($c == 0)
    {
        //no previous button
        echo('<img src="images/icons/control_start.gif" height="16px" width="16px" alt="" />'); //previous
        echo("  |  ");
        counter($table, $search, $have_submitted, $white, $yellow);
        echo("  |  ");
        echo('<a href="?c=' . $c = $c + 10 .'&search=' . $search . '&search_param=' . $table .  '&have_submitted=' . $have_submitted . '&x=0&y=0&white=' . $white . '&yellow=' . $yellow . '"><img src="images/icons/control_end_blue.gif" height="16px" width="16px" alt="" /></a>'); //next
    }
    elseif($c > $count_nonum)
    {
        //all buttons
        echo('<a href="?c=' . ($c - 10) . '&search=' . $search . '&search_param=' . $table .  '&amp;have_submitted=' . $have_submitted . '&x=0&y=0&white=' . $white . '&yellow=' . $yellow . '"><img src="images/icons/control_start_blue.gif" height="16px" width="16px" alt="" /></a>'); //previous
        echo("  |  ");
        counter($table, $search, $have_submitted, $white, $yellow);
        echo("  |  ");
        echo('<a href="?c=' . ($c + 10) . '&search=' . $search . '&search_param=' . $table .  '&have_submitted=' . $have_submitted . '&x=0&y=0&white=' . $white . '&yellow=' . $yellow . '"><img src="images/icons/control_end_blue.gif" height="16px" width="16px" alt="" /></a>'); //next  
    }
    else{        
        //no next button
        echo('<a href="?c=' . ($c - 10) . '&search=' . $search . '&search_param=' . $table .  '&have_submitted=' . $have_submitted . '&x=0&y=0&white=' . $white . '&yellow=' . $yellow . '"><img src="images/icons/control_start_blue.gif" height="16px" width="16px" alt="" /></a>'); //previous
        echo("  |  ");
        counter($table, $search, $have_submitted, $white, $yellow);
        echo("  |  ");
        echo('<img src="images/icons/control_end.gif" height="16px" width="16px" alt="" />'); //next 
    }

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.