nero1009 Posted December 11, 2007 Share Posted December 11, 2007 ok i am building a paginating page query 50 results perpage using loop I am lost any ideas Will Thank in advance ??? function build_comments_form($pub, $status='pending', $page='0') { $perPage = 50; $start = $perPage * $page; $page=0; if($status == 'all') $comments = mysql_query("SELECT * FROM tblcommentsall WHERE PubID232 = '".PUB_ID232."' ORDER BY comment_id DESC LIMIT $start,$perPage"); else $comments = mysql_query("SELECT * FROM tblcommentsall WHERE $status = 1 AND PubID = '".PUB_ID."' ORDER BY comment_id DESC LIMIT $start,$perPage"); $totalPages = mysql_num_rows($comments) / $perPage; # if there is a previous page -> echo previous link # if there is a previous page -> echo previous link if($page > 1){ $prev = ($page - 1); echo "<a href=\"<a href=\"http://205.147.195.141/sitesadmin/comments_dev/pub_index.php?status=$status&page=$prev\"><<Previous</a>"; } if($page > 1){ $next = ($page + 1); echo "<a href=\"<a href=\"http://205.147.195.141/sitesadmin/comments_dev/pub_index.php?status=$status&page=$next\">Next>></a>"; } echo "</right>"; # for total number of pages # loop though totalPages -> each page -> echo page # link $page=1; do { $page++; echo "" . $perPage . "<br />"; } while ($page<2); Quote Link to comment https://forums.phpfreaks.com/topic/81223-pagnating-50-comment-results-to-a-page/ Share on other sites More sharing options...
teng84 Posted December 13, 2007 Share Posted December 13, 2007 what help? Quote Link to comment https://forums.phpfreaks.com/topic/81223-pagnating-50-comment-results-to-a-page/#findComment-413476 Share on other sites More sharing options...
redbullmarky Posted December 13, 2007 Share Posted December 13, 2007 please make sure your next topic is posted in the correct section - this has nothing to do with OOP. Also, you might want to be a bit more clear about what problems you're getting with the code - errors, issues, unexpected behaviour, etc. we can't just guess Quote Link to comment https://forums.phpfreaks.com/topic/81223-pagnating-50-comment-results-to-a-page/#findComment-413622 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.