Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host AND Logon.Enabled=1'); while($Logon = $DbResult->fetch_assoc()) { //echo($Logon['Id'].','); if($System->NetworkPortState($Logon['Address'], $Logon['Port'])) $State = 1; else $State = 0; $System->Database->query('UPDATE Logon SET Online='.$State.' WHERE Id='.$Logon['Id']); } // Check realms $DbResult = $System->Database->query('SELECT Realm.Id, Host.Address, Realm.Port FROM Realm JOIN Host ON Host.Id=Realm.Host AND Realm.Enabled=1'); while($Realm = $DbResult->fetch_assoc()) { //echo($Realm['Id'].','); if($System->NetworkPortState($Realm['Address'], $Realm['Port'])) $State = 1; else $State = 0; $System->Database->query('UPDATE Realm SET Online='.$State.' WHERE Id='.$Realm['Id']); } ?>