Guest User

PHP query for OnlinePlayers-SQL Bukkit Plugin

a guest
Mar 23rd, 2012
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2.  
  3. // MySQL connect & db select
  4. $link = mysql_connect('localhost', 'root', 'password');
  5. if (!$link) {
  6.     die('Could not connect: ' . mysql_error());
  7. } else {
  8.     mysql_select_db('database', $link);
  9. }
  10.  
  11. // MySQL Query and Dispaly
  12.     $result = mysql_query("SELECT * FROM online_players2 ORDER BY logon_time ASC");
  13.     $list = null;
  14.     while($row = mysql_fetch_array($result))
  15.     {
  16.         $list .= $row['current_world'] . '-' . $row['player'].'<br />';
  17.     }
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment