Jump to content

automatic reset every 12 hours


nibor

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.