LOUDMOUTH Posted March 25, 2009 Share Posted March 25, 2009 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 More sharing options...
LOUDMOUTH Posted March 25, 2009 Author Share Posted March 25, 2009 Link to comment https://forums.phpfreaks.com/topic/150995-solved-update-the-timer-and-db/#findComment-793308 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.