• 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!

[Modern AAC] Fragers.php, Zero showing

Pete Doherty

New Member
Joined
Sep 12, 2008
Messages
60
Reaction score
0
I get a zero showing in my fragers.php.

I can't figure out what it is though.

Code:
$i = 0; 
foreach($SQL->query('SELECT `p`.`name` AS `name`, COUNT(`p`.`name`) as `frags` 
 FROM `killers` k 
 LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` 
 LEFT JOIN `players` p ON `pk`.`player_id` = `p`.`id` 
WHERE `k`.`unjustified` = 1 AND `k`.`final_hit` = 1 
 GROUP BY `name` 
 ORDER BY `frags` DESC, `name` ASC 
 LIMIT 0,30;') as $player) 
{ 
 $i++; 
 echo '<tr> 
  <td><a href="'.WEBSITE.'/index.php/character/view/'.$player['name'].'"><center>' . $player['name'] . '</center></a></td> 
  <td><center>' . $player['frags'] . '</center></td> 
 </tr>'; 
}
 
View attachment 12793

As seen in the picture, the "zero" also makes a row appear as if it was a player without a name/perhaps a deleted character? (This picture is taken just after I deleted ALL kill history).

It's obvious it has something to do with "$player['frags']" since the zero disappears when this line is removed. It also disappears when I type "LIMIT 1,30" instead of 0,30, but this is obviously not an option since it messes up other things.


Anyone? REP++!
 
Back
Top