Jump to content

Septharoth

New Members
  • Posts

    4
  • Joined

  • Last visited

Septharoth's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php include 'core/classes/Query.php'; include 'core/functions/recaptchalib.php'; $sqlQ = "SELECT * FROM `servers`"; $qResult = $database->query($sqlQ); $i = 0; while ($row = $qResult->fetch_assoc()) { $query = new Query($row['address'], $row['query_port'], $row['engine']); $info = $query->query(); if(!$info) { $info = $query->return_false(); } $details = array( 'players' => $info['players'], 'details' => $info['details'] ); $details = json_encode($details); $update = $database->prepare("UPDATE `servers` SET `status` = ?, `online_players` = ?, `maximum_online_players` = ?, `map` = ?, `details` = ?, `cachetime` = unix_timestamp() WHERE `server_id` = {$row['server_id']}" $update->bind_param('sssss', $query->status, $info['general']['online_players']['value'], $info['general']['maximum_online_players']['value'], $info['general']['map']['value'], $details) $update->execute(); } ?> What I'm trying to accomplish is query every server & update every one of the rows for each server listed. This does nothing ( its a cronjob , as it has to run every 5 minutes , newbie so not entirely sure if this is event the right approach )
  2. Best answer anyone's given me on the subject yet. Thank you so much, I figured I would have to cache some data, but wasn't entirely sure how to go about it. You more than solved this issue. THANK YOU!
  3. Hey there, PHPFreaks! I've had quite the experience in the registration process. For some reason captchas DO NOT want to work for me here Took me like 12+ tries to get it, usually it's a first try thing.. haha But, I hope to expand my php knowledge here, as I've been playing with it now for a few months.
  4. Basically, I've created a game serverlist in php. After some time, I've noticed in the console of two of my game servers I noticed it's spamming connections every time a user connects to the page(this happens a LOT, since people check the SLN often), it's been causing a bit of lag ingame when there is 10+ simultaneous connections from my webserver. Is there a way I can have the php code only execute every X minutes, so even if a user is connecting to the page, it will show the outputted data from the last check in? I'm using the fsockopen function to check the server's status, and other methods to query the server for information. This is the last thing I need to do for this project to be perfect, some help would be greatly appreciated ^^
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.