[PHP]Sort Multiple pages

Joined
Oct 7, 2008
Messages
580
Reaction score
15
Connection to MSSQL


i mean like the pages in go next page previous page
how do i make those ?
it must generate the pages automatically

Example 5 contents in 1 pages

Help pls ?
 
Heres a pic of wat i needed
can be of any design

katsumi - [PHP]Sort Multiple pages - RaGEZONE Forums
 
i do not know how to do those
i want to put that in my rankings page

And my ranking pages code is like this

Also i want it to automatically generate pages
Like show 1st 50 rankings in 1st page and the nest 50 in the next page and so on .....
Code:
<?
if ($_GET['expand'] == 1){
?>
				<tr>
					<td width="917" colspan="5" height="26" style="background-image: url('images/subbar.jpg'); background-repeat: no-repeat; background-position: center top">
					<p align="center">
					<a href="index.php?do=ranking&sub=individual&expand=1">
					<img border="0" src="http://forum.ragezone.com/images/subbar/individualranking.jpg" width="128" height="13"></a><a href="index.php?do=ranking&sub=clan&expand=1"><img border="0" src="http://forum.ragezone.com/images/subbar/clanranking.jpg" width="99" height="13"></a><a href="index.php?do=ranking&sub=hof&expand=1"><img border="0" src="http://forum.ragezone.com/images/subbar/halloffame.jpg" width="93" height="13"></a></td>
				</tr>

<? }

if($_GET['expand'] == 0){

switch($_GET['sub']){
    case "individual";
        ShowIndividualRanking();
    break;
    case "clan";
        ShowClanRanking();
    break;
}
}


if(!function_exists("ShowIndividualRanking")){
function ShowIndividualRanking(){
    $res = mssql_query("SELECT TOP 50 * FROM Character ORDER BY XP DESC");
    $count = 0;
    ?>


<head>
<meta http-equiv="Content-Language" content="es">
<link rel="stylesheet" type="text/css" href="http://forum.ragezone.com/images/style.css">
</head>

	<body bgcolor="#312F30">

					<div align="center">
						<table border="0" width="456" style="border-collapse: collapse">
							<tr>
								<td background="http://forum.ragezone.com/images/cont_up.jpg"> </td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_bg.jpg">
								<div align="center">
									<table border="0" style="border-collapse: collapse" width="454" height="100%">
										<tr>
											<td width="4" rowspan="6"> </td>
											<td width="436">
											<img border="0" src="http://forum.ragezone.com/images/inf/individualranking.jpg"></td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											 </td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											<div align="center">
												<table border="0" width="421" style="border-collapse: collapse; background-image: url('images/rankinglist.jpg'); background-repeat: no-repeat; background-position: center top">
													<tr>
														<td>
														<table border="0" style="border-collapse: collapse" width="100%" height="100%">
															<tr>
																<td height="30"> </td>
															</tr>
															<tr>
																<td style="background-image: url('images/rankinlist_bg.gif'); background-repeat: repeat; background-position: center top">
																<table border="0" style="border-collapse: collapse" width="417" height="100%">
                                                                <?
                                                                    while($r = mssql_fetch_assoc($res)){
                                                                    $count++;
                                                                    ?>
																	<tr>
																		<td width="45">
																		<p align="center">
																		<?=$count?></td>
																		<td width="88">
																		<p align="center">
																		<b>
																		<span class="guild_name">
																		<?=$r['Name']?></span></b>
																		</td>
																		<td width="33">
																		<p align="center">
																		<?=$r['Level']?></td>
																		<td width="127">
																		<p align="center">
																		<?=number_format($r['XP'],0,'','.');?></td>
																		<td width="114">
																		<p align="center">
																		<span style="font-size: 7pt">
																		<?=$r['KillCount']?>/<?=$r['DeathCount']?>
																		(80%)</span></td>
																	</tr> <?}?>
																</table>
																</td>
															</tr>
														</table>
														</td>
													</tr>
												</table>
											</div>
											</td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434" height="24">
											<center>
											 </center></td>
											<td width="8" height="24"> </td>
										</tr>
									</table>
								</div>
								</td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_top.jpg" height="27"> </td>
							</tr>
						</table>
					</div>
    <?
} }

if(!function_exists("ShowClanRanking")){
function ShowClanRanking(){
    $res = mssql_query("SELECT TOP 50 * FROM Clan ORDER BY Ranking DESC");
    ?>
<body bgcolor="#312F30">

					<div align="center">
						<table border="0" width="456" style="border-collapse: collapse">
							<tr>
								<td background="http://forum.ragezone.com/images/cont_up.jpg"> </td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_bg.jpg">
								<div align="center">
									<table border="0" style="border-collapse: collapse" width="454" height="100%">
										<tr>
											<td width="4" rowspan="6"> </td>
											<td width="436">
											<img border="0" src="http://forum.ragezone.com/images/inf/clanraking.jpg" width="413" height="17"></td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											 </td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											<div align="center">
												<table border="0" width="421" style="border-collapse: collapse; background-image: url('images/clanranking_list.jpg'); background-repeat: no-repeat; background-position: center top">
													<tr>
														<td>
														<table border="0" style="border-collapse: collapse" width="100%" height="100%">
															<tr>
																<td height="30"> </td>
															</tr>
															<tr>
																<td style="background-image: url('images/clanranking_list_bg.gif'); background-repeat: repeat; background-position: center top">
																<table border="0" style="border-collapse: collapse" width="417" height="100%">
                                                                    <? while($r = mssql_fetch_assoc($res)){   ?>

                                                                    <tr>
																		<td width="45">
																		<p align="center">
																		<?=$r['Ranking']?></td>
																		<td width="90">
																		<p align="center">
																		<b><?=$r['Name']?></b></td>
																		<td width="76">
																		<p align="center">
																		<? $res2 = mssql_query("SELECT * FROM Character WHERE CID = '".$r['MasterCID']."'");
                                                                            $c = mssql_fetch_assoc($res2);
                                                                            echo $c['Name'];
                                                                        ?></td>
																		<td width="71">
																		<p align="center">
																		<?=$r['Wins']?>/<?=$r['Losses']?></td>
																		<td width="40">
																		<p align="center">
																		79%</td>
																		<td width="83">
																		<p align="center">
																		<?=$r['TotalPoint']?></td>
																	</tr>  <?}?>
																</table>
																</td>
															</tr>
														</table>
														</td>
													</tr>
												</table>
											</div>
											</td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434" height="24">
											<center>
											 </center></td>
											<td width="8" height="24"> </td>
										</tr>
									</table>
								</div>
								</td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_top.jpg" height="27"> </td>
							</tr>
						</table>
					</div>
    <?
} }





?>
 
PHP:
limit 0,50

I don't think that will work with MsSQL.. The code she has is like this:
PHP:
res = mssql_query("SELECT TOP 50 * FROM Clan ORDER BY Ranking DESC");

I don't have, nor have I ever used MsSql.... So i don't know. but TOP 50 is something new for me to see in a query lol

But if you coded this your self, and you know PHP, it should be easy enough for you to put what you want together.

Just do something like this:
PHP:
<?php
if(!$_GET['highScoreLimit'])  
	$highScoreLimit = '0, 50'; 
else 
	$highScoreLimit = $_GET['highScoreLimit']; 
$totalScoresQuery = mssql_query('SELECT * FROM Clan'); 
$mssql_num_rows = mssql_num_rows($totalScoresQuery);
$totalScoresPageCount = round($mssql_num_rows/50); 
for($i=0;$i<$totalScoresPageCount;$i++) { 
	$pages[$i] = ($i*50).','.($i+1)*50; 
	if($i == $totalScoresPageCount-1) 
		$pages[$i] = ($i*50).','.$mssql_num_rows; 
	echo '<a href="'.$_SERVER['PHP_SELF'].'?highScoreLimit='.$pages[$i].'">'.($i+1).'</a> '; 
} 
echo '<hr>'; 
echo $highScoreLimit;
$res = mssql_query('SELECT * FROM Clan ORDER BY Ranking DESC LIMIT '.$highScoreLimit.' ');  
?>

EDIT:
Okay so I got it working with an example of 777 as the total scores you want to check:

DO NOT USE THIS CODE, USE THE CODE PROVIDED ABOVE. but you can see how it works by going here. (this page will be deleted in 24 hours)
PHP:
<?php
if(!$_GET['highScoreLimit'])  
	$highScoreLimit = '0, 50'; 
else 
	$highScoreLimit = $_GET['highScoreLimit']; 
//$totalScoresQuery = mssql_query('SELECT * FROM Clan'); 
$mssql_num_rows = 777;//mssql_num_rows($totalScoresQuery)
$totalScoresPageCount = round($mssql_num_rows/50); 
for($i=0;$i<$totalScoresPageCount;$i++) { 
	$pages[$i] = ($i*50).', '.($i+1)*50; 
	if($i == $totalScoresPageCount-1) 
		$pages[$i] = ($i*50).', '.$mssql_num_rows; 
	echo '<a href="'.$_SERVER['PHP_SELF'].'?highScoreLimit='.$pages[$i].'">'.($i+1).'</a> '; 
} 
echo '<hr>'; 
echo $highScoreLimit;
//$res = mssql_query('SELECT * FROM Clan ORDER BY Ranking DESC LIMIT '.$highScoreLimit.' ');  
?>
 
i get this error
on s-p-n's code & Superfun 's code
Thank you for helping :)


Code:
Warning: mssql_fetch_assoc(): supplied argument is not a valid MS SQL-result resource in C:\Xammp\htdocs\ranking.php on line 90
and my line 90 looks like this
Code:
                                                                   while($r = mssql_fetch_assoc($res)){
                                                                    $count++;
I think we will have to include 2 functin in that line 90
i.e $res and $highScoreLimit in s-p-n's
& $res and $a & $b in Super funs

how do i solve it ?
 
That error simply indicates that you're using fetch_assoc on a variable that doesn't hold a MSSQL resultset. That means either you're using it on the wrong variable or there's a problem with the query (syntax or something).
 
Okay I did some MsSQL research for you, and this is what I came up with. Hope it works :)

Replace the code where it says $res='.....'; with this bundle:
PHP:
<?php 
if(!$_GET['highScoreLimit'])   
    $highScoreLimit = '50';  
else  
    $highScoreLimit = $_GET['highScoreLimit'];  
$totalScoresQuery = mssql_query('SELECT * FROM Clan');  
$mssql_num_rows = mssql_num_rows($totalScoresQuery); 
$totalScoresPageCount = round($mssql_num_rows/50);  
for($i=0;$i<$totalScoresPageCount;$i++) {  
    $pages[$i] = ($i+1)*50;
    echo '<a href="'.$_SERVER['PHP_SELF'].'?highScoreLimit='.$pages[$i].'">'.($i+1).'</a> ';  
}  
echo '<hr>';  
$res = mssql_query('SELECT TOP '.$highScoreLimit.' * FROM Clan WHERE Clan NOT IN(SELECT TOP '.($highScoreLimit-50).' * FROM Clan ORDER BY Ranking DESC) ORDER BY Ranking DESC ');   
?>

Now if you go here you'll see the query that's doing the work instead of just the limit that only works with MySQL.
 
i dont know y it doesnt work

can u merge it on this page ?

Code:
<?
if ($_GET['expand'] == 1){
?>
				<tr>
					<td width="917" colspan="5" height="26" style="background-image: url('images/subbar.jpg'); background-repeat: no-repeat; background-position: center top">
					<p align="center">
					<a href="index.php?do=ranking&sub=individual&expand=1">
					<img border="0" src="http://forum.ragezone.com/images/subbar/individualranking.jpg" width="128" height="13"></a><a href="index.php?do=ranking&sub=clan&expand=1"><img border="0" src="http://forum.ragezone.com/images/subbar/clanranking.jpg" width="99" height="13"></a><a href="index.php?do=ranking&sub=hof&expand=1"><img border="0" src="http://forum.ragezone.com/images/subbar/halloffame.jpg" width="93" height="13"></a></td>
				</tr>

<? }

if($_GET['expand'] == 0){

switch($_GET['sub']){
    case "individual";
        ShowIndividualRanking();
    break;
    case "clan";
        ShowClanRanking();
    break;
}
}


if(!function_exists("ShowIndividualRanking")){
function ShowIndividualRanking(){
    $res = mssql_query("SELECT TOP 50 * FROM Character ORDER BY XP DESC");
    $count = 0;
    ?>


<head>
<meta http-equiv="Content-Language" content="es">
<link rel="stylesheet" type="text/css" href="http://forum.ragezone.com/images/style.css">
</head>

	<body bgcolor="#312F30">

					<div align="center">
						<table border="0" width="456" style="border-collapse: collapse">
							<tr>
								<td background="http://forum.ragezone.com/images/cont_up.jpg"> </td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_bg.jpg">
								<div align="center">
									<table border="0" style="border-collapse: collapse" width="454" height="100%">
										<tr>
											<td width="4" rowspan="6"> </td>
											<td width="436">
											<img border="0" src="http://forum.ragezone.com/images/inf/individualranking.jpg"></td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											 </td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											<div align="center">
												<table border="0" width="421" style="border-collapse: collapse; background-image: url('images/rankinglist.jpg'); background-repeat: no-repeat; background-position: center top">
													<tr>
														<td>
														<table border="0" style="border-collapse: collapse" width="100%" height="100%">
															<tr>
																<td height="30"> </td>
															</tr>
															<tr>
																<td style="background-image: url('images/rankinlist_bg.gif'); background-repeat: repeat; background-position: center top">
																<table border="0" style="border-collapse: collapse" width="417" height="100%">
                                                                <?
                                                                    while($r = mssql_fetch_assoc($res)){
                                                                    $count++;
                                                                    ?>
																	<tr>
																		<td width="45">
																		<p align="center">
																		<?=$count?></td>
																		<td width="88">
																		<p align="center">
																		<b>
																		<span class="guild_name">
																		<?=$r['Name']?></span></b>
																		</td>
																		<td width="33">
																		<p align="center">
																		<?=$r['Level']?></td>
																		<td width="127">
																		<p align="center">
																		<?=number_format($r['XP'],0,'','.');?></td>
																		<td width="114">
																		<p align="center">
																		<span style="font-size: 7pt">
																		<?=$r['KillCount']?>/<?=$r['DeathCount']?>
																		(80%)</span></td>
																	</tr> <?}?>
																</table>
																</td>
															</tr>
														</table>
														</td>
													</tr>
												</table>
											</div>
											</td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434" height="24">
											<center>
											 </center></td>
											<td width="8" height="24"> </td>
										</tr>
									</table>
								</div>
								</td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_top.jpg" height="27"> </td>
							</tr>
						</table>
					</div>
    <?
} }

if(!function_exists("ShowClanRanking")){
function ShowClanRanking(){
    $res = mssql_query("SELECT TOP 50 * FROM Clan ORDER BY Ranking DESC");
    ?>
<body bgcolor="#312F30">

					<div align="center">
						<table border="0" width="456" style="border-collapse: collapse">
							<tr>
								<td background="http://forum.ragezone.com/images/cont_up.jpg"> </td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_bg.jpg">
								<div align="center">
									<table border="0" style="border-collapse: collapse" width="454" height="100%">
										<tr>
											<td width="4" rowspan="6"> </td>
											<td width="436">
											<img border="0" src="http://forum.ragezone.com/images/inf/clanraking.jpg" width="413" height="17"></td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											 </td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											<div align="center">
												<table border="0" width="421" style="border-collapse: collapse; background-image: url('images/clanranking_list.jpg'); background-repeat: no-repeat; background-position: center top">
													<tr>
														<td>
														<table border="0" style="border-collapse: collapse" width="100%" height="100%">
															<tr>
																<td height="30"> </td>
															</tr>
															<tr>
																<td style="background-image: url('images/clanranking_list_bg.gif'); background-repeat: repeat; background-position: center top">
																<table border="0" style="border-collapse: collapse" width="417" height="100%">
                                                                    <? while($r = mssql_fetch_assoc($res)){   ?>

                                                                    <tr>
																		<td width="45">
																		<p align="center">
																		<?=$r['Ranking']?></td>
																		<td width="90">
																		<p align="center">
																		<b><?=$r['Name']?></b></td>
																		<td width="76">
																		<p align="center">
																		<? $res2 = mssql_query("SELECT * FROM Character WHERE CID = '".$r['MasterCID']."'");
                                                                            $c = mssql_fetch_assoc($res2);
                                                                            echo $c['Name'];
                                                                        ?></td>
																		<td width="71">
																		<p align="center">
																		<?=$r['Wins']?>/<?=$r['Losses']?></td>
																		<td width="40">
																		<p align="center">
																		79%</td>
																		<td width="83">
																		<p align="center">
																		<?=$r['TotalPoint']?></td>
																	</tr>  <?}?>
																</table>
																</td>
															</tr>
														</table>
														</td>
													</tr>
												</table>
											</div>
											</td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434" height="24">
											<center>
											 </center></td>
											<td width="8" height="24"> </td>
										</tr>
									</table>
								</div>
								</td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_top.jpg" height="27"> </td>
							</tr>
						</table>
					</div>
    <?
} }





?>
 
Code:
<?
if ($_GET['expand'] == 1){
?>
				<tr>
					<td width="917" colspan="5" height="26" style="background-image: url('images/subbar.jpg'); background-repeat: no-repeat; background-position: center top">
					<p align="center">
					<a href="index.php?do=ranking&sub=individual&expand=1">
					<img border="0" src="http://forum.ragezone.com/images/subbar/individualranking.jpg" width="128" height="13"></a><a href="index.php?do=ranking&sub=clan&expand=1"><img border="0" src="http://forum.ragezone.com/images/subbar/clanranking.jpg" width="99" height="13"></a><a href="index.php?do=ranking&sub=hof&expand=1"><img border="0" src="http://forum.ragezone.com/images/subbar/halloffame.jpg" width="93" height="13"></a></td>
				</tr>

<? }

if($_GET['expand'] == 0){

switch($_GET['sub']){
    case "individual";
        ShowIndividualRanking();
    break;
    case "clan";
        ShowClanRanking();
    break;
}
}


if(!function_exists("ShowIndividualRanking")){
function ShowIndividualRanking(){
    $res = mssql_query("SELECT TOP 50 * FROM Character ORDER BY XP DESC");
    $count = 0;
    ?>


<head>
<meta http-equiv="Content-Language" content="es">
<link rel="stylesheet" type="text/css" href="http://forum.ragezone.com/images/style.css">
</head>

	<body bgcolor="#312F30">

					<div align="center">
						<table border="0" width="456" style="border-collapse: collapse">
							<tr>
								<td background="http://forum.ragezone.com/images/cont_up.jpg"> </td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_bg.jpg">
								<div align="center">
									<table border="0" style="border-collapse: collapse" width="454" height="100%">
										<tr>
											<td width="4" rowspan="6"> </td>
											<td width="436">
											<img border="0" src="http://forum.ragezone.com/images/inf/individualranking.jpg"></td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											 </td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											<div align="center">
												<table border="0" width="421" style="border-collapse: collapse; background-image: url('images/rankinglist.jpg'); background-repeat: no-repeat; background-position: center top">
													<tr>
														<td>
														<table border="0" style="border-collapse: collapse" width="100%" height="100%">
															<tr>
																<td height="30"> </td>
															</tr>
															<tr>
																<td style="background-image: url('images/rankinlist_bg.gif'); background-repeat: repeat; background-position: center top">
																<table border="0" style="border-collapse: collapse" width="417" height="100%">
                                                                <?
                                                                    while($r = mssql_fetch_assoc($res)){
                                                                    $count++;
                                                                    ?>
																	<tr>
																		<td width="45">
																		<p align="center">
																		<?=$count?></td>
																		<td width="88">
																		<p align="center">
																		<b>
																		<span class="guild_name">
																		<?=$r['Name']?></span></b>
																		</td>
																		<td width="33">
																		<p align="center">
																		<?=$r['Level']?></td>
																		<td width="127">
																		<p align="center">
																		<?=number_format($r['XP'],0,'','.');?></td>
																		<td width="114">
																		<p align="center">
																		<span style="font-size: 7pt">
																		<?=$r['KillCount']?>/<?=$r['DeathCount']?>
																		(80%)</span></td>
																	</tr> <?}?>
																</table>
																</td>
															</tr>
														</table>
														</td>
													</tr>
												</table>
											</div>
											</td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434" height="24">
											<center>
											 </center></td>
											<td width="8" height="24"> </td>
										</tr>
									</table>
								</div>
								</td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_top.jpg" height="27"> </td>
							</tr>
						</table>
					</div>
    <?
} }

if(!function_exists("ShowClanRanking")){
function ShowClanRanking(){
    if(!$_GET['highScoreLimit'])    
    $highScoreLimit = '50';   
else  {
    $highScoreLimit = $_GET['highScoreLimit'];   
    $totalScoresQuery = mssql_query('SELECT * FROM Clan');   
    $mssql_num_rows = mssql_num_rows($totalScoresQuery);  
    $totalScoresPageCount = round($mssql_num_rows/50);   
    for($i=0;$i<$totalScoresPageCount;$i++) {   
         $pages[$i] = ($i+1)*50; 
         echo '<a href="'.$_SERVER['PHP_SELF'].'?highScoreLimit='.$pages[$i].'">'.($i+1).'</a> ';   
     }   
     echo '<hr>';   
     $res = mssql_query('SELECT TOP '.$highScoreLimit.' * FROM Clan WHERE Clan NOT IN(SELECT TOP '.($highScoreLimit-50).' * FROM Clan ORDER BY Ranking DESC) ORDER BY Ranking DESC ');
} ?>
<body bgcolor="#312F30">

					<div align="center">
						<table border="0" width="456" style="border-collapse: collapse">
							<tr>
								<td background="http://forum.ragezone.com/images/cont_up.jpg"> </td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_bg.jpg">
								<div align="center">
									<table border="0" style="border-collapse: collapse" width="454" height="100%">
										<tr>
											<td width="4" rowspan="6"> </td>
											<td width="436">
											<img border="0" src="http://forum.ragezone.com/images/inf/clanraking.jpg" width="413" height="17"></td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											 </td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434">
											<div align="center">
												<table border="0" width="421" style="border-collapse: collapse; background-image: url('images/clanranking_list.jpg'); background-repeat: no-repeat; background-position: center top">
													<tr>
														<td>
														<table border="0" style="border-collapse: collapse" width="100%" height="100%">
															<tr>
																<td height="30"> </td>
															</tr>
															<tr>
																<td style="background-image: url('images/clanranking_list_bg.gif'); background-repeat: repeat; background-position: center top">
																<table border="0" style="border-collapse: collapse" width="417" height="100%">
                                                                    <? while($r = mssql_fetch_assoc($res)){   ?>

                                                                    <tr>
																		<td width="45">
																		<p align="center">
																		<?=$r['Ranking']?></td>
																		<td width="90">
																		<p align="center">
																		<b><?=$r['Name']?></b></td>
																		<td width="76">
																		<p align="center">
																		<? $res2 = mssql_query("SELECT * FROM Character WHERE CID = '".$r['MasterCID']."'");
                                                                            $c = mssql_fetch_assoc($res2);
                                                                            echo $c['Name'];
                                                                        ?></td>
																		<td width="71">
																		<p align="center">
																		<?=$r['Wins']?>/<?=$r['Losses']?></td>
																		<td width="40">
																		<p align="center">
																		79%</td>
																		<td width="83">
																		<p align="center">
																		<?=$r['TotalPoint']?></td>
																	</tr>  <?}?>
																</table>
																</td>
															</tr>
														</table>
														</td>
													</tr>
												</table>
											</div>
											</td>
											<td width="8"> </td>
										</tr>
										<tr>
											<td width="434" height="24">
											<center>
											 </center></td>
											<td width="8" height="24"> </td>
										</tr>
									</table>
								</div>
								</td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/cont_top.jpg" height="27"> </td>
							</tr>
						</table>
					</div>
    <?
} }





?>

There I put it in where it should be.. Next time, if it doesn't work, reply with the problem. If there's an error, post the error message. If it works, but the numbers are in the wrong place, just reply and say that. If it does absolutly nothing, then say that. Don't just bump for more help and say it doesn't work....

And I'm not using any mysql, that's MsSQL. I don't have a way to test the query, but I got it from a site where the person had the same problem as you; That is, MsSQL Limit difficulties. Hope this works. Oh, and you do have more than 50 high scores, don't you? If not, then it won't work as you expect since there would only be one page.
 
@ spn i used ur code and i got this error

Code:
Warning: mssql_fetch_assoc(): supplied argument is not a valid MS SQL-result resource in C:\Xammp\htdocs\web\mod_ranking.php on line 179
Sry for being Afk these many days
 
Back