Advertisement
Guest User

Untitled

a guest
May 29th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. <?
  2. $host = "127.0.0.1"; // here is your Database address
  3. $mysql_user = "root"; // Database UserName
  4. $mysql_pass ="xxxxxxx"; // Database Password
  5. $db = "mangos"; //Database Name
  6.  
  7. $gm_color="#FF0000"; // This is the GM color at list and u can change it!
  8.  
  9. @mysql_connect ("$host", "$mysql_user", "$mysql_pass") or die ("MySql Connection Error");
  10. @mysql_select_db ("$db") or die ("Database Connection Has Failed");
  11.  
  12. $query = mysql_query("SELECT name, gmstate, online FROM `character` WHERE `online`= 1 ORDER BY name");
  13. $count=0;
  14. while ($row_list = mysql_fetch_object($query)) {
  15.     if ( $row_list->gmstate == 1 ) {
  16.         $count++;
  17.         print ("<font color=\"$gm_color\">");
  18.         echo $row_list->name;
  19.         print ("</font>, ");
  20.     }
  21.    else{
  22.         echo $row_list->name;
  23.         print (", ");
  24.         $count++;
  25.     }
  26. }
  27.    print ("<center><br><br>$count Players Online<br><br></center>");
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement