techiefreak05 Posted September 11, 2006 Share Posted September 11, 2006 i have this code that displays all your friends bullletins.. and it limits 5 per page.. well its supposed to .. lets say there are 7 bulletins posted.. it shows all 7 on one page.. but says there are 2 pages of bulletins, like tis supposed to.. idk whats wrong.... you see anything?!?!?!??!!?[code]<?php$query="SELECT * FROM friends WHERE `username` = '$_SESSION[username]' AND `accepted` = 'yes'";$result=mysql_query($query);while($array=mysql_fetch_assoc($result)){$poster = $array['friend'];$user = $_SESSION[username];if(!isset($_GET['bulletinPage'])){ $Bpage = 1; } else { $Bpage = $_GET['bulletinPage']; } $max_results = 5; $from = (($Bpage * $max_results) - $max_results); $query2="SELECT * FROM `bulletins` WHERE `from` = '$poster' ORDER by 'id' DESC LIMIT $from, $max_results";$result2=mysql_query($query2);while($array=mysql_fetch_assoc($result2)){echo "<table bgcolor=#99CCFF width=200><tr bgcolor=#548099><td height=28><b><font color=white>From: <a href='getInfo.php?user=" . $array['from'] . "'>" . $array['from'] . "</a></b><br><b>Date: </b>" .$array['date']; echo "</b></font></td></tr></table>"; echo "<table bgcolor=#99CCFF width=200><tr bgcolor=#356B8B><td height=25><center><a href=\"showBulletin.php?id=".$array['id']."\">Subject: ".$array['subject']."</a></center>"; echo "</td></tr></table><hr>"; }}$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM bulletins WHERE `from` = '$poster'"),0); $total_pages = ceil($total_results / $max_results); ?><b>Page: </b><?phpif($Bpage > 1){ $prev = ($Bpage - 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?bulletinPage=$prev\"></a>"; } for($i = 1; $i <= $total_pages; $i++){ if(($Bpage) == $i){ echo "$i "; } else { echo "<a href=\"".$_SERVER['PHP_SELF']."?bulletinPage=$i\">$i</a> "; } } if($Bpage < $total_pages){ $next = ($Bpage + 1); echo "<a href=\"".$_SERVER['PHP_SELF']."?bulletinPage=$next\"></a>";} ?>[/code] Link to comment https://forums.phpfreaks.com/topic/20353-pagination-problems-please-please-help-me/ Share on other sites More sharing options...
techiefreak05 Posted September 11, 2006 Author Share Posted September 11, 2006 please please take a look!! im really really in a bad time to have it not working!! Link to comment https://forums.phpfreaks.com/topic/20353-pagination-problems-please-please-help-me/#findComment-89647 Share on other sites More sharing options...
kenrbnsn Posted September 11, 2006 Share Posted September 11, 2006 Please do not bump your request so soon after posting it. If you must bump it wait at least [b]4 to 8 hours[/b].Ken Link to comment https://forums.phpfreaks.com/topic/20353-pagination-problems-please-please-help-me/#findComment-89648 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.