• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Frags page

Aleada

Unknown Member
Joined
Mar 14, 2013
Messages
231
Reaction score
7
Heya everyone, I'm trying to make a frags page for my website but it's only showing 1 player (The player with the most frags) it's not showing more than 1 :/ it's probably something really simple but I can't seem to figure it out :/ Anyways... here's the scripts:

PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?> 
<h2>Top PVP Players</h2> 
<?php
$getfrags = mysql_query("SELECT `frags`, `level`, `name` FROM `players` ORDER BY `frags` DESC");
$fetchfrags = mysql_fetch_assoc($getfrags);
$frags = $fetchfrags['frags'];
	echo '<table border="0"> 
	<tr class="yellow"><td>Player</td><td>Level</td><td>Frags</td></tr>'; 
    echo '<tr><td>'; 
    echo '<a href="characterprofile.php?name='.$fetchfrags['name'].'">'.$fetchfrags['name'].'</a>';
    echo '</td><td>'; 
    echo $fetchfrags['level']; 
    echo '</td><td>'; 
    echo $frags;
    echo '</td></tr>';
	echo '</table>'; 
?>
<?php include 'layout/overall/footer.php'; ?>

Btw I'm using Znote AAC!
 
Try this:
PHP:
<?php require_once 'engine/init.php'; include 'layout/overall/header.php'; ?>  
<h2>Top PVP Players</h2>  
<?php 
$getfrags = mysql_query("SELECT `frags`, `level`, `name` FROM `players` ORDER BY `frags` DESC"); 
$fetchfrags = mysql_fetch_assoc($getfrags);
foreach($fetchfrags as $frags)
{
    echo '<table border="0">  
    <tr class="yellow"><td>Player</td><td>Level</td><td>Frags</td></tr>';  
    echo '<tr><td>';  
    echo '<a href="characterprofile.php?name='.$frags['name'].'">'.$frags['name'].'</a>'; 
    echo '</td><td>';  
    echo $frags['level'];  
    echo '</td><td>';  
    echo $frags['frags'];
    echo '</td></tr>';
    echo '</table>';
}
?> 
<?php include 'layout/overall/footer.php'; ?>
 
Doesn't work with the table I'm trying to use though :/ That's why I tried to make my own but it didn't work out too well xD
 
Just edit the query from Znote's post :p

PHP:
$killers = mysql_select_multi("SELECT `frags`, `name`, `level` FROM `players` WHERE `frags` > 0 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0,30;");
 
o_O I didn't think that would work lmfao thank you so much Ninja! And also, thank you Amino12 for trying! :) Rep to both of you!
 
Back
Top