Try this one if you cant or not able to set CRON jobs.Quote:
Hi there it's me again.
I wanna update the serverstats all 10 seconds in my db. I wanted to use a cronjob but my server does only allow them in a 1 minute interval. So I thought I could make the updatescript update the stats 5 times (all 10 secs) and close then. I wanted to make use of a for loop and timers but this doesn't work:
Heres the code (is there no way in this board to use an expander?)
WAt the moment when i run this script the page is loading for years and the stats are not updated a single time.PHP Code:<?php
$_REQUEST["host"] = "gwgt1.joymax.com";
$_REQUEST["port"] = 15779;
$_REQUEST["locale"] = 18;
$_REQUEST["version"] = 314;
$_REQUEST["timeout"] = 5;
$db = mysqli_connect(blabla);
if (mysqli_connect_errno() == 0) { //DB-Connection successful
for ($i = 1; $i <= 5; $i++) {
$Timer = microtime(TRUE);
// Execute the server stats page and store the results. This code doesn't change.
ob_start();
include( "ServerStats.php" );
$result = ob_get_contents();
ob_end_clean();
//code that updates the db, definitely works!
//let 10 seconds pass
while (microtime(TRUE) - $Timer <= 10000) {
usleep(500000); //0.5 secs sleeping
}
}
}
?>
Any idea what could be the issue? I'm really not a pro in php^^
Regards
But there are also some web based cron job websites, but they are not realy helpfull
[Only registered and activated users can see links. Click Here To Register...]