Advertisement
SkullCrack

/Web inferance for mangos/ Onlineplayers.php

Jun 28th, 2011
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. require_once ( 'config.php');
  4.  
  5. $cxn = mysql_connect($Hostname, $Username, $Password);
  6. $db = mysql_select_db ($CharDatabase,$cxn);
  7.         if (!$db) {
  8.                 die ('Error : ' . mysql_error());
  9.         }
  10.         $characters_online = mysql_query("SELECT * FROM `characters` WHERE `online` = '1'");    
  11.         $online_players = mysql_num_rows($characters_online);
  12.         if ($online_players > 0) {
  13.                 echo '<strong><font color=#138f39>Players online :<br> '.$online_players.'  </font></strong>';
  14.         }else
  15.         {
  16.                 echo '<strong><font color=#af1e1e>There are no players <br> online</font></strong>';
  17.         }
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement