Advertisement
Guest User

Untitled

a guest
Jan 10th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. <!-- START Highscores -->
  2.  
  3. <div class="content_box info_box content_box_bottom_link" id="highscoreInfoBox">
  4. <h1>Highscore-List</h1>
  5. <div class="info_box_content">
  6.  
  7. <p>
  8. </p>
  9. <p class="bold">
  10. Hier unsere Top 10 der besten Spieler: </p>
  11. <table border="0" class="rank">
  12. <thead>
  13. <tr>
  14. <th>
  15. <span class="first"></span> Rang </th>
  16. <th class="name">
  17. Benutzername </th>
  18. <th>
  19. Level </th>
  20. </tr>
  21. </thead>
  22. <tbody id="top10" name="top10">
  23.  
  24.  
  25. <?php
  26. $servername = "localhost";
  27. $username = "root";
  28. $password = "ZENSIERT";
  29. $dbname = "ZENSIERT";
  30.  
  31. // Create connection
  32. $conn = new mysqli($servername, $username, $password, $dbname);
  33. // Check connection
  34. if ($conn->connect_error) {
  35. die("Connection failed: " . $conn->connect_error);
  36. }
  37.  
  38. $sql = "SELECT name, level FROM characters order by level desc limit 0 , 10";
  39. $result = $conn->query($sql);
  40.  
  41. if ($result->num_rows > 0) {
  42. $x = 0;
  43. // output data of each row
  44. while($row = $result->fetch_assoc()) {
  45.  
  46. $x = $x + 1;
  47. echo "
  48. <tr>
  49. <td>".
  50. $x."
  51. </td>
  52. <td>".
  53.  
  54. $row['name']."
  55. </td>
  56. <td>
  57.  
  58. ".$row['level']."
  59. </td>
  60.  
  61. </tr>
  62. ";
  63.  
  64. }
  65. } else {
  66.  
  67. }
  68. $conn->close();
  69.  
  70. ?>
  71.  
  72.  
  73.  
  74. </tbody>
  75. </table>
  76. <div id="selectServer">
  77.  
  78. <label>
  79. Server:
  80. </label>
  81. <select onchange="callhighscore();" name="serverchoice" class="select_skin" id="serverchoice" onchange="submit();">
  82. <option value="1" selected="selected">
  83. <?php echo $server; ?> </option>
  84. </select>
  85. </div>
  86.  
  87. </div>
  88. <a class="bottom_link" href="/main/highscore/">
  89. <span></span> Zu den Highscores </a>
  90. </div>
  91. <!-- ENDE Hightscores-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement