Im Jake Posted June 13, 2008 Share Posted June 13, 2008 thats my php script, it takes 1 second to ping each server, well my webhost times out after 30-45 seconds, so after that long it times out after i get 30-45 servers on the status page, how can i make it so that it will do it quicker or ping more servers every second? <?php include("includes/connection.inc.php"); $results = @mysql_query("SELECT id, name, ip, port, uptime, status FROM servers") or die(); while($values = mysql_fetch_array($results)){ list($online, $offline) = explode(',', $values['uptime']); $socket = @fsockopen(stripslashes($values['ip']), stripslashes($values['port']), $errno, $errstr, 1); if($socket){ $status = 'online'; $online = intval($online) + 1; } else{ $status = 'offline'; $offline = intval($offline) + 1; } $uptime = $online . ',' . $offline; echo 'Server: ' . $values['name'] . ' is ' . $status . '<br />'; $resultsUpdate = @mysql_query("UPDATE servers SET uptime='$uptime', status='$status' WHERE id=" . $values['id']) or die(); } $time = time(); $resultsTime = @mysql_query("UPDATE config SET lastupdate='$time'") or die(); ?> Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 13, 2008 Share Posted June 13, 2008 You can try paginating it after every 20 servers to be safe. Quote Link to comment Share on other sites More sharing options...
Im Jake Posted June 14, 2008 Author Share Posted June 14, 2008 You can try paginating it after every 20 servers to be safe. how would i do that Quote Link to comment Share on other sites More sharing options...
Im Jake Posted June 14, 2008 Author Share Posted June 14, 2008 Hello?!!??!?! Quote Link to comment Share on other sites More sharing options...
Im Jake Posted June 16, 2008 Author Share Posted June 16, 2008 been 3 days... Quote Link to comment Share on other sites More sharing options...
Jabop Posted June 16, 2008 Share Posted June 16, 2008 In the last 3 days, did you try: http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=com.ubuntu%3Aen-US%3Aunofficial&hs=dH0&q=paginating+mysql+php&btnG=Search Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted June 16, 2008 Share Posted June 16, 2008 or ping more servers every second Use fping...http://fping.sourceforge.net/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.