Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>StatsGrabber Test</title>
- </head>
- <body>
- <?php
- function printPlayer($resultobj){
- echo('<b>'.$resultobj->player.'</b><br/>');
- echo('Last Login: '.$resultobj->stats->lastlogin.'<br/>');
- echo('Last Logout: '.$resultobj->stats->lastlogout.'<br/>');
- echo('Played For: ' .$resultobj->stats->playedfor.'<br/>');
- echo('Kill / Death Ratio: '.$resultobj->stats->killdeathratio.'<br/>');
- echo('Player Kill / Death Ratio: '.$resultobj->stats->playerkilldeathratio.'<br/><br/>');
- }
- ?>
- <h2>StatsGrabber Test</h2>
- <h3>Get statistics for player <tt>Tehbeard</tt>:</h3>
- <pre>
- QUERY: "player='Tehbeard'"<br/><br/>
- <?php
- include('statsGrabber.php');
- $sg = new StatsGrabber('localhost', 'root', '', 'stats');
- $result = $sg->getStats("player='Tehbeard'");
- foreach($result as $resultobj)
- printPlayer($resultobj);
- ?>
- </pre>
- <h3>Get statistic for all players who have played at least 35 hours:</h3>
- <pre>
- QUERY: "category='stats' AND stat='playedfor' AND value > 126000"<br/><br/>
- <?php
- $result = $sg->getStats("category='stats' AND stat='playedfor' AND value > 126000");
- foreach($result as $resultobj)
- printPlayer($resultobj);
- ?>
- </pre>
- </body>
- </html>
Add Comment
Please, Sign In to add comment