Mod-Jay Posted December 12, 2010 Share Posted December 12, 2010 Hi im trying to Make a Timer count down in this code function getTime($host, $user, $pass, $db, $hours, $ip, $serverId) { $c = @mysql_connect($host, $user, $pass); if(mysql_select_db($db, $c)) { $dateQ = mysql_query('SELECT MAX(date) AS lastVoteDate FROM `'. $db .'`.`votes` WHERE ip="'. $ip .'"') or die(mysql_error()); $getDate = mysql_fetch_assoc($dateQ); $diffrence = time() - strtotime($getDate['lastVoteDate']); $hours = number_format(($diffrence / 60 / 60)); $minutes = number_format(($hours / 60)); if(!$hours < 1){ return ("". $hours .""); } else { return ("0"); } } else { return array(1, "Error connecting to DB."); } } Quote Link to comment https://forums.phpfreaks.com/topic/221374-vote-timer/ Share on other sites More sharing options...
trq Posted December 13, 2010 Share Posted December 13, 2010 And? Quote Link to comment https://forums.phpfreaks.com/topic/221374-vote-timer/#findComment-1146435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.