Ok im developing a turn based game for a project, i can get the timers that im using to work using cronjobs because it is simple enough to do but i cant work out how to get the timers to give out the turns without using the cronjobs.
<?
include("html/funcs.php");
$getgames = mysql_query("SELECT round,speed,maxbuild FROM $tab[game] WHERE starts<$time AND ends>$time ORDER BY round ASC;");
while ($game = mysql_fetch_array($getgames))
{
mysql_query("UPDATE r$game[0]_$tab[pimp] SET trn=trn+$game[1] WHERE trn<$game[2];");
if (!fetch("SELECT lastran FROM r$game[0]_$tab[cron] WHERE cronjob='turns';"))
{ mysql_query("INSERT INTO r$game[0]_$tab[cron] VALUES ('turns','$time');"); }
else { mysql_query("UPDATE r$game[0]_$tab[cron] SET lastran='$time' WHERE cronjob='turns'"); }
}
?>
is the code im using in the cronjob to execute every 10 mins but due to costs and the unreliability of the cronjobs i want to have it so after 10mins or 5 mins passing it then updates turns but how is it done?