nibor Posted June 22, 2006 Share Posted June 22, 2006 in my php made game. I'm having trouble on how it would automatically reset and refresh players stats every 12 hours. the reset file i made which codes are below. It only works when i manually run that script which is going to reset.php file. Can someone please help me out, , want it to reset from server time 0:00:00 and every 12 hours, it would refresh again automatically.[code]$a=mysql_query("SELECT id,name FROM members");while($b=mysql_fetch_array($a)){$msg="A New Day Has Come, You Have Been Awarded <b>500</b> Buds";mysql_query("INSERT INTO news (who,message,date) VALUES ('$b[id]','$msg','".time()."')");}mysql_query("UPDATE members SET bank=bank+500");mysql_query("UPDATE members SET daysplayed=daysplayed+1");mysql_query("UPDATE clan SET age=age+1");mysql_query("UPDATE members SET stamina=maxstamina");mysql_query("UPDATE members SET powerball=maxpowerball");mysql_query("UPDATE members SET life=maxlife");[/code]Thanks - saizen Link to comment https://forums.phpfreaks.com/topic/12618-automatic-reset-every-12-hours/ Share on other sites More sharing options...
.josh Posted June 22, 2006 Share Posted June 22, 2006 setup a cron job to run it every 12 hours Link to comment https://forums.phpfreaks.com/topic/12618-automatic-reset-every-12-hours/#findComment-48387 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.