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
https://forums.phpfreaks.com/topic/58457-if-statement-woes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.