Jump to content


automatic reset every 12 hours

  • Please log in to reply
1 reply to this topic

#1 nibor

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 22 June 2006 - 06:34 AM

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.

$a=mysql_query("SELECT id,name FROM members");
$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");

- saizen

#2 .josh

  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 22 June 2006 - 06:51 AM

setup a cron job to run it every 12 hours
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users