Jump to content

[SOLVED] for loop not working


dreamwest

Recommended Posts

Trying to use paginate but the for loop isnt working . Somtimes ill only have 26 results (2 pages) but the links show -5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 in the

'>."$k."</a>";

part

 

 
$tpage = ceil( 453 / 25 );
$search = GET['search_id'];
$k = 1 - 5;

    for (  ; $k <= 1 + 5; ++$k )
    {
        if (( 0 < $k ) || ( $k <= 18.25 ) )
        {
            $page_links .= "<a class=pagination href='search.php?page=".$k."&search_id=".$search." '>."$k."</a>";
        }
    }

Link to comment
https://forums.phpfreaks.com/topic/144302-solved-for-loop-not-working/
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.