feat: solve real rank
This commit is contained in:
parent
b5672b2326
commit
25874a4643
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
session_start();
|
||||
require_once "config/db.php";
|
||||
|
||||
@ -17,6 +17,10 @@ if ($result_me && mysqli_num_rows($result_me)>0){
|
||||
$score = $row['score'];
|
||||
}
|
||||
|
||||
$queryrank = "SELECT COUNT(*) as ranking FROM users WHERE score > $score";
|
||||
$resultrank = mysqli_query($db, $queryrank);
|
||||
$rowrank = mysqli_fetch_assoc($resultrank);
|
||||
$realrank = $rowrank['ranking']+1;
|
||||
|
||||
$result = mysqli_query($db, $sql);
|
||||
$leaderboard = [];
|
||||
@ -87,7 +91,7 @@ if($result){
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php echo $peringkat; ?></td>
|
||||
<td><?php echo $realrank; ?></td>
|
||||
<td><?php echo $nama; ?></td>
|
||||
|
||||
<td><?php echo $pemain['score']; ?> PTS</td>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user