grlayouts Posted April 4, 2007 Share Posted April 4, 2007 OK i have a rank script that places players acesending orders by level, how can i make it show onlt the 10 players on either side in the player. IE the ten players above and below. The code i have is <?php print "<table border=0.5 bgcolor=AC7928>"; print "<tr><td height=20 width=35 bgcolor=#AC7928><b> <center>Rank</center></td><td width=100 bgcolor=#AC7928><b>Name</td><td width=60 bgcolor=#AC7928><b><center>I.D</center></td><td width=30 bgcolor=#AC7928><b><center>Level</center></td><td width=100 bgcolor=#AC7928><b><center>Rank Score</center></td><td width=60 bgcolor=#AC7928><b><center>Fight</center></td></tr>"; $msel = mysql_query("select * from players where jail !='21' order by level desc limit 25"); $ranka = 0; while ($mem = mysql_fetch_array($msel)) { $ranka++; ?> <?php $stats1=$mem[level]; $stats2=$mem[max_hp]; $stats3=$mem[wins]; $stats4=$mem[exp]; $stats4=$mem[knowledge]; $stats6=$mem[losses]; $ranks=($stats1+$stats2+$stats3+$stats4-$stats5) ?> <?php print "<tr><td height=15><center>$ranka</center></td><td height=15><A href=view.php?view=$mem[id]><font style=color:white>$mem[user]</td><td><center>$mem[id]</center></td><td><center>$mem[level]</center></td><td><center>$ranks</center></td></td><td ><A href=battle.php?battle=$mem[id]><font style=color:#FFFFFF><center>Attack</center></td></tr>"; } print "</table><br>"; ?> Link to comment https://forums.phpfreaks.com/topic/45528-list-10-either-way/ Share on other sites More sharing options...
monk.e.boy Posted April 4, 2007 Share Posted April 4, 2007 What sort of values does 'level' range from? Are they all different? monk.e.boy Link to comment https://forums.phpfreaks.com/topic/45528-list-10-either-way/#findComment-221045 Share on other sites More sharing options...
grlayouts Posted April 4, 2007 Author Share Posted April 4, 2007 1-99 for level. Link to comment https://forums.phpfreaks.com/topic/45528-list-10-either-way/#findComment-221244 Share on other sites More sharing options...
grlayouts Posted April 7, 2007 Author Share Posted April 7, 2007 ne1? Link to comment https://forums.phpfreaks.com/topic/45528-list-10-either-way/#findComment-223501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.