Changeset 427 for beta/inc/server.php


Ignore:
Timestamp:
Feb 10, 2009, 4:45:05 PM (16 years ago)
Author:
amun
Message:

Funkce pracující s MySQL napojeny na globalni config db.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • beta/inc/server.php

    r405 r427  
    4848      public function MangosOnline()
    4949      {
    50         $this -> db -> select_db("realm1_characters");
     50           include("inc/db.php");
     51        $this -> db -> select_db($db_characters);
    5152        $pocet = $this -> db -> query("SELECT `guid` FROM `characters` WHERE `online` = '1'") -> num_rows;
    5253        return $pocet;
     
    7879      public function ServerUptime ()
    7980      {
    80         $this -> db -> select_db("realm1_mangos");
     81           include("inc/db.php");
     82        $this -> db -> select_db($db_mangos);
    8183        $row = $this -> db -> query('SELECT `starttime`, `uptime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1') ->fetch_array();
    8284        $uptime = round($row["uptime"] / 3600);
     
    8688      public function CharacterCount()
    8789      {
    88         $this -> db -> select_db("realm1_characters");
     90           include("inc/db.php");
     91        $this -> db -> select_db($db_characters);
    8992        $row = $this -> db -> query("SELECT COUNT(*) FROM characters") -> fetch_array();
    9093        return($row[0]);
     
    9396      public function AccountCount()
    9497      {
    95         $this -> db -> select_db("realm1_realmd");
     98           include("inc/db.php");
     99        $this -> db -> select_db($db_realmd);
    96100        $row = $this -> db -> query("SELECT COUNT(*) FROM account") -> fetch_array();
    97101        return($row[0]);
     
    100104      public function GuidToCharName ($guid)
    101105      {
    102         $this -> db -> select_db("realm1_characters");
     106           include("inc/db.php");
     107        $this -> db -> select_db($db_characters);
    103108        $row = $this -> db -> query("SELECT `name` FROM `characters` WHERE `guid` = '".$guid."' LIMIT 1;") -> fetch_array();
    104109        return $row["name"];
Note: See TracChangeset for help on using the changeset viewer.