Simple website with some JavaScript games.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
819 B

  1. <?php
  2. //5-17-17
  3. echo '<h1 class="w3-text-teal"><center>High Scores</center></h1>';
  4. $q = "select * from scores where game = '$game_id' order by score desc limit 20";
  5. $q = "select score, users.user_name username from scores inner join users on users.user_id=scores.user_id where game = '$game_id' order by score desc limit 20";
  6. $r = $db->query($q);
  7. echo '<div class="w3-responsive w3-card-4"><table class="w3-table w3-striped
  8. w3-bordered"><thead>';
  9. echo '<tr class="w3-theme">
  10. <td>Rank</td>
  11. <td>User Name</td>
  12. <td>Score</td>
  13. </tr></thead><tbody>';
  14. $rank = 0;
  15. while($row = $r->fetchArray())
  16. {
  17. $rank ++;
  18. echo '<tr>';
  19. echo '<td>' . $rank . '</td>';
  20. echo '<td>' . $row['username'] . '</td>';
  21. echo '<td>' . $row['score'] . '</td>';
  22. echo '</tr>';
  23. }
  24. echo '</tbody></table></div>';