Advertisement
Guest User

Untitled

a guest
Mar 15th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php
  3. // Configuration
  4. $hostname = 'projectpactscripting.com';
  5. $username = 'ProjectPact';
  6. $password = 'password';
  7. $database = 'AIO_Hunter';
  8.  
  9. try {
  10. $dbh = new PDO('mysql:host='. $hostname .';dbname='. $database, $username, $password);
  11. } catch(PDOException $e) {
  12. echo '<h1>An error has occurred.</h1><pre>', $e->getMessage() ,'</pre>';
  13. }
  14.  
  15. $sth = $dbh->query('SELECT * FROM Data ORDER BY timeran DESC');
  16. $sth->setFetchMode(PDO::FETCH_ASSOC);
  17.  
  18. $result = $sth->fetchAll();
  19. ?>
  20. <html>
  21. <head>
  22. <title>Highscores</title>
  23. <link rel="stylesheet" type="text/css" href="http://ctrl.software/semantic/dist/semantic.min.css">
  24. <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  25. <script src="http://ctrl.software/Stupid-Table/stupidtable.min.js"></script>
  26. <script src="http://ctrl.software/semantic/dist/semantic.min.js"></script>
  27. </head>
  28. <body>
  29. <br>
  30. <br>
  31. <div class="ui container">
  32. <table class="ui fluid celled green table">
  33. <thead>
  34. <tr>
  35. <th>Rank</th>
  36. <th>Username</th>
  37. <th>Time ran</th>
  38. <th>XP gained</th>
  39. <th>NPCs caught</th>
  40. <th>Profit</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. <?php
  45. if(count($result) > 0) {
  46. $rank = 1;
  47. foreach($result as $r) {
  48. echo '<tr>/n';
  49. echo '<td>'.$r['Username'].'</td><td>'.$r['timeran'].'</td><td>'.$r['expgained'].'</td><td>'.$r['NPC_Caught'].'</td><td>'.$r['profit'].'</td>/n';
  50.  
  51.  
  52. echo '</tr>/n';
  53.  
  54. $rank++;
  55. }
  56. }
  57. ?>
  58. </tbody>
  59. </div>
  60. </div>
  61. </body>
  62. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement