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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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