Jump to content

Vote Timer


Mod-Jay

Recommended Posts

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.");
      }   
}

Link to comment
https://forums.phpfreaks.com/topic/221374-vote-timer/
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.