Changeset 10 for scripts/online.php
- Timestamp:
- Jun 6, 2008, 9:12:32 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/online.php
r8 r10 48 48 49 49 // Calculate latency average 50 $DbResult = $Database->query("SELECT AVG(`latency`) as `latency` FROM `servers_online` WHERE `server` = ".$Server['id']." AND `state` = 1 AND `latency` != 0");50 $DbResult = $Database->query("SELECT COALESCE(AVG(`latency`), 0) as `latency` FROM `servers_online` WHERE `server` = ".$Server['id']." AND `state` = 1 AND `latency` != 0"); 51 51 $DbRow = $DbResult->fetch_array(); 52 52 $Latency = $DbRow['latency']; … … 54 54 55 55 // Calculate cached percentage online state 56 $DbResult = $Database->query("SELECT CO UNT(*) as `count`, SUM(`state`) as `online` FROM `servers_online` WHERE `server` = ".$Server['id']);56 $DbResult = $Database->query("SELECT COALESCE(COUNT(*), 1) as `count`, COALESCE(SUM(`state`), 0) as `online` FROM `servers_online` WHERE `server` = ".$Server['id']); 57 57 $DbRow = $DbResult->fetch_array(); 58 58
Note:
See TracChangeset
for help on using the changeset viewer.