law Posted May 12, 2008 Share Posted May 12, 2008 Now if I could only get this simple pagination to work!! any one see what i'm doing wrong? if (isset($_GET['galno'])) { $pageno = $_GET['galno']; } else { $pageno = 1; } $pageno = (int)$pageno; if ($pageno > $num_rows) { $pageno = $num_rows; } if ($pageno < 1) { $pageno = 1; } if ($pageno == 1) { echo " FIRST PREV "; } else { echo " <a href='./index.php#Community?galno=1'>FIRST</a> "; $prevpage = $pageno - 1; echo " <a href='./index.php#Community?galno=$prevpage'>PREV</a> "; } if ($pageno == $num_rows) { echo " NEXT LAST "; } else { $nextpage = $pageno + 1; echo " <a href='./index.php#Community?galno=$nextpage'>NEXT</a> "; echo " <a href='./index.php#Community?galno=$num_rows'>LAST</a> "; } echo " ( Page $pageno of $num_rows ) "; $num = $pageno; $num_rows = the number of galleries I want to display in my database $num = is in the gallery code to pick out what gallery to show #Community = the page "container" where the galleries are located The issue is that the $pageno always = 1.. that means the if($_GET(clause)) is never true? and i have no idea why?? Link to comment https://forums.phpfreaks.com/topic/105213-solved-i-finally-found-a-reason-to-paginate/ Share on other sites More sharing options...
sasa Posted May 12, 2008 Share Posted May 12, 2008 move #Community to the end of url Link to comment https://forums.phpfreaks.com/topic/105213-solved-i-finally-found-a-reason-to-paginate/#findComment-538765 Share on other sites More sharing options...
phpretard Posted May 12, 2008 Share Posted May 12, 2008 What's a paginate suppost to do? I have never heard of it. Gt a link or something or is it simple to explain? Link to comment https://forums.phpfreaks.com/topic/105213-solved-i-finally-found-a-reason-to-paginate/#findComment-538768 Share on other sites More sharing options...
haku Posted May 12, 2008 Share Posted May 12, 2008 The issue is that the $pageno always = 1.. that means the if($_GET(clause)) is never true? and i have no idea why?? It means one of three things: 1) isset($_GET['galno']) is always evaluating to false (maybe your variable is named something other than galno?) 2) $num_rows is less than or equal to 1 3) $_GET['galno'] is equal to 1. Your problem lies in one of these three things. Link to comment https://forums.phpfreaks.com/topic/105213-solved-i-finally-found-a-reason-to-paginate/#findComment-538878 Share on other sites More sharing options...
Cobby Posted May 12, 2008 Share Posted May 12, 2008 What's a paginate suppost to do? I have never heard of it. Gt a link or something or is it simple to explain? Its a term used to shorten search results, etc. Best google a popular term and check down the bottom of the page (Prev 1 2 3 4 Next). Imagine if every google search result was on the one page. As for the OP, I would suggest die()-ing your major variables so see what their actually values are, or maybe var_dump(). And then doing this inside your condition statements to see if they're actually executing. Link to comment https://forums.phpfreaks.com/topic/105213-solved-i-finally-found-a-reason-to-paginate/#findComment-538895 Share on other sites More sharing options...
law Posted May 12, 2008 Author Share Posted May 12, 2008 move #Community to the end of url you nailed it! ... thanks a ton Link to comment https://forums.phpfreaks.com/topic/105213-solved-i-finally-found-a-reason-to-paginate/#findComment-539478 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.