whodat225 Posted February 26, 2010 Share Posted February 26, 2010 Can anyone tell me how to add pagination to this code? [php<? include "functions/config.php"; include "functions/functions.php"; include "functions/ban.php"; $id = mysql_real_escape_string($_GET['id']); $team = mysql_query("SELECT * FROM cs_teams WHERE id = '$id'"); while($team1 = mysql_fetch_array($team)) { $theteam = $team1['teamname']; $banner = $cons['banner']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title><? echo $sitename ?> - <? echo $theteam ?>'s Roster</title> <meta name="description" content="Combat Scripts - Demo Page" /> <meta name="keywords" content="Ladder, ladder, tournament, Tournament, Clan Ladder, Clan Tournament" /> <link href="./styles/combatscript.css" type="text/css" rel="stylesheet"> <script type="text/javascript" src="./styles/anylinkcssmenu.js"></script> <script type="text/javascript"> anylinkcssmenu.init("anchorclass") </script> </head> <body> <? include "navigation.php" ?> <div id="section5"> <div id="ladderstandings"> <div id="theladder"> <div id="details"> <div class="title">Team Member</div> <div class="title">Rank</div> <div class="tgames">Country</div> <div class="wins">Email</div> <div class="losses">PM</div> <div class="rep">Game</div> <div class="vd">View Profile</div> </div> <? $color1 = "alt1"; $color2 = "alt2"; $rank = 1; $queryr = mysql_query("SELECT * FROM `cs_team` WHERE tid = '$id'"); while($rowr = mysql_fetch_array($queryr)) { $pid = $rowr['pid']; $queryo = mysql_query("SELECT * FROM `cs_joined` WHERE tid = '$id' GROUP BY `lid`"); while($rowo = mysql_fetch_array($queryo)) { $ladder = $rowo['lid']; $queryi = mysql_query("SELECT * FROM `cs_ladders` WHERE id = '$ladder'"); while($rowi = mysql_fetch_array($queryi)) { $gid = $rowi['game']; $queryj = mysql_query("SELECT * FROM `cs_games` WHERE id = '$gid'"); while($rowj = mysql_fetch_array($queryj)) { $icon = $rowj['image']; } } } $queryt = mysql_query("SELECT * FROM `cs_bio` WHERE id = '$pid'"); while($rowt = mysql_fetch_array($queryt)) { $title = $rowt['title']; $name = $rowt['username']; $losses = $rowt['losses']; $pm = $rowt['pm']; $prank = $rowr['rank']; $game = $rowt['gameid']; $email = $rowt['email']; $country = $rowt['country']; $foid = $rowt['fid']; $sid = $rowt['id']; $divColor = ($rank % 2) ? $color1 : $color2; if($prank==10) $prank= "Recruit"; elseif($prank== 99) $prank= "Team Creator"; elseif($prank== 98) $prank = "Captain"; elseif($prank== 88) $prank= "Co-Captain"; elseif($prank== 20) $prank= "Member"; ?> <div class="<? echo $divColor ?>"> <div class="title"><? echo $name ?></div> <div class="title"><? echo $prank ?></div> <div class="tgames"><img src="images/flags/<? echo $country ?>.gif" alt=""></div> <div class="wins"><a href=""><img src="images/extra/mail.gif" alt=""></a></div> <div class="losses"><a href="<? echo $siteurl ?>/<? echo $forum ?>/private.php?do=newpm&u=<? echo $foid ?>"><img src="images/extra/pm.gif" alt=""></a></div> <div class="rep"><a href=""><img class="popicon" src="uploads/games/<? echo $icon ?>" width"16" height="16" alt=""></a></div> <div class="vd"><a href="player.php?&id=<? echo $sid ?>">View</a></div> </div> <? $rank++; } } ?> </div> </div> <div id="extra"> <? echo '<div class="spacer" align="center"><b>Pages</b>: '.$prevText.' '.$nav.' '.$nextText.'</div>'; ?> </div> </div> <div id="sidead"> <div id="sideadvert"> <? echo $tall ?> </div> </div> <div id="footads"> <div id="fad"> <? echo $foot1 ?> <? echo $foot2 ?> </div> <div id="fad1"></div> </div> <div id="clr"></div> </div> <div id="bottombar">Copyright © 2010.</div> </body> </html> ][/code] Link to comment https://forums.phpfreaks.com/topic/193422-adding-pagination/ Share on other sites More sharing options...
nilansanjaya Posted February 26, 2010 Share Posted February 26, 2010 to b honest , i ddn read all your code but anywy ive attached a pagination class. use it ! [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/193422-adding-pagination/#findComment-1018336 Share on other sites More sharing options...
whodat225 Posted February 26, 2010 Author Share Posted February 26, 2010 I do not know enough about php to make that work. If I have to give someone a few $ to make this work I will. Link to comment https://forums.phpfreaks.com/topic/193422-adding-pagination/#findComment-1018341 Share on other sites More sharing options...
nilansanjaya Posted February 26, 2010 Share Posted February 26, 2010 u gonna pay me ? lolz Link to comment https://forums.phpfreaks.com/topic/193422-adding-pagination/#findComment-1018343 Share on other sites More sharing options...
New Coder Posted February 26, 2010 Share Posted February 26, 2010 I think that would be very useful for me. Thanks nilansanjaya Link to comment https://forums.phpfreaks.com/topic/193422-adding-pagination/#findComment-1018421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.