Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- // Configuration
- $hostname = 'projectpactscripting.com';
- $username = 'ProjectPact';
- $password = 'password';
- $database = 'AIO_Hunter';
- try {
- $dbh = new PDO('mysql:host='. $hostname .';dbname='. $database, $username, $password);
- } catch(PDOException $e) {
- echo '<h1>An error has occurred.</h1><pre>', $e->getMessage() ,'</pre>';
- }
- $sth = $dbh->query('SELECT * FROM Data ORDER BY timeran DESC');
- $sth->setFetchMode(PDO::FETCH_ASSOC);
- $result = $sth->fetchAll();
- ?>
- <html>
- <head>
- <title>Highscores</title>
- <link rel="stylesheet" type="text/css" href="http://ctrl.software/semantic/dist/semantic.min.css">
- <script src="http://code.jquery.com/jquery-latest.min.js"></script>
- <script src="http://ctrl.software/Stupid-Table/stupidtable.min.js"></script>
- <script src="http://ctrl.software/semantic/dist/semantic.min.js"></script>
- </head>
- <body>
- <br>
- <br>
- <div class="ui container">
- <table class="ui fluid celled green table">
- <thead>
- <tr>
- <th>Rank</th>
- <th>Username</th>
- <th>Time ran</th>
- <th>XP gained</th>
- <th>NPCs caught</th>
- <th>Profit</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(count($result) > 0) {
- $rank = 1;
- foreach($result as $r) {
- echo '<tr>/n';
- echo '<td>'.$r['Username'].'</td><td>'.$r['timeran'].'</td><td>'.$r['expgained'].'</td><td>'.$r['NPC_Caught'].'</td><td>'.$r['profit'].'</td>/n';
- echo '</tr>/n';
- $rank++;
- }
- }
- ?>
- </tbody>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement