dreamwest Posted February 8, 2009 Share Posted February 8, 2009 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 More sharing options...
sasa Posted February 8, 2009 Share Posted February 8, 2009 change || to and in if statemant Link to comment https://forums.phpfreaks.com/topic/144302-solved-for-loop-not-working/#findComment-757263 Share on other sites More sharing options...
dreamwest Posted February 8, 2009 Author Share Posted February 8, 2009 Brilliant! Thanks Link to comment https://forums.phpfreaks.com/topic/144302-solved-for-loop-not-working/#findComment-757284 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.