Changeset 596 for trunk/inc


Ignore:
Timestamp:
May 20, 2009, 8:26:17 AM (16 years ago)
Author:
george
Message:
  • Přidáno: Třída pro systém omezování počtu registrací. Automatické povolování registrací dle předchozího počtu hráčů online vůči zadané požadované hodnotě.
Location:
trunk/inc
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/server.php

    r583 r596  
    2727   
    2828    $this->db->select_db($Config['Mangos']['DatabaseRealmd']);
    29     $pocet = $this->db->query('SELECT `id` FROM `account` WHERE `online` = 1')->num_rows;
    30     return($pocet);
     29    $DbResult = $this->db->query('SELECT COUNT(*) FROM `account` WHERE `online` = 1');
     30    $DbRow = $DbResult->fetch_row();
     31    return($DbRow[0]);
    3132  }
    3233
     
    4849    global $Config;
    4950   
    50     $this->db->select_db($Config['Mangos']['DatabaseCharacters']);
    51     $pocet = $this->db->query('SELECT `guid` FROM `characters` WHERE `online` = 1')->num_rows;
    52     return($pocet);
     51    $this->db->select_db($Config['Mangos']['DatabaseCharacters']);   
     52    $DbResult = $this->db->query('SELECT COUNT(*) FROM `characters` WHERE `online` = 1');
     53    $DbRow = $DbResult->fetch_row();
     54    return($DbRow[0]);
    5355  }
    5456
     
    8789
    8890    $this->db->select_db($Config['Mangos']['DatabaseCharacters']);
    89     $row = $this->db->query('SELECT COUNT(*) FROM characters')->fetch_array();
     91    $row = $this->db->query('SELECT COUNT(*) FROM characters')->fetch_row();
    9092    return($row[0]);
    9193  }
     
    9698
    9799    $this->db->select_db($Config['Mangos']['DatabaseRealmd']);
    98     $row = $this->db->query('SELECT COUNT(*) FROM account')->fetch_array();
     100    $row = $this->db->query('SELECT COUNT(*) FROM account')->fetch_row();
    99101    return($row[0]);
    100102  }
Note: See TracChangeset for help on using the changeset viewer.