Jump to content

[SOLVED] //update the timer and db


LOUDMOUTH

Recommended Posts

This is to update the timer in my DB and let the user know how much time they have left in the hospital in a game. 

 

Is there a way to make this more accurate?  For some reason once in a while the timer is getting stuck and not telling people the time is counting down.

 

please help!

 


$thetime = time();

$result2 = mysql_query("UPDATE `updates` SET `lastdone` = '".$thetime."' WHERE `name` = 'hospital'");

$leftovertime = $timesinceupdate - (floor($timesinceupdate / 60) * 60);

if ($leftovertime>0) {

	$newupdate =  time() - $leftovertime;

	$setleftovertime = mysql_query("UPDATE `updates` SET `lastdone` = '".$newupdate."' WHERE `name` = 'hospital'");

}

Link to comment
https://forums.phpfreaks.com/topic/150995-solved-update-the-timer-and-db/
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.