Changeset 40


Ignore:
Timestamp:
Jun 16, 2009, 6:16:36 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Chyba načtení uptime serveru pokud chybí tato tabulka v novém místě.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/server.php

    r39 r40  
    137137      $DbRow = $DbResult->fetch_row();
    138138      $State['AccountCount'] = $DbRow[0];
    139       $DbResult = $this->Database->query('SELECT uptime FROM server'.$this->Id.'_realmd.uptime AS T ORDER BY T.startstring DESC');
    140       $DbRow = $DbResult->fetch_assoc();
    141       $State['Uptime'] = $DbRow['uptime'];
     139      $DbResult = $this->Database->query('SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = "server'.$this->Id.'_realmd" AND TABLE_NAME = "uptime"');
     140      $DbRow = $DbResult->fetch_row();
     141      if($DbRow[0] > 0)
     142      {
     143        $DbResult = $this->Database->query('SELECT uptime FROM server'.$this->Id.'_realmd.uptime AS T ORDER BY T.startstring DESC');
     144        $DbRow = $DbResult->fetch_assoc();
     145        $State['Uptime'] = $DbRow['uptime'];
     146      } else $State['Uptime'] = 0;
    142147    } else
    143148    {
Note: See TracChangeset for help on using the changeset viewer.