title: activity in past hour
body: <p>I am trying to work out if users have had activity in the past hour. The following is my code, but it always returns yes, no matter what:</p>
  
  <pre><code>$houraway = (int)mktime() + (60 * 60);
  $now = mktime();
  
  while($user = mysql_fetch_array($qusers))   {
      echo $user['Name']." - ";
      $datetime = explode(" ", $user['Custom6']);
      $date = $datetime[0];
      $date = explode("-", $date);
      $time = $datetime[1];
      $time = explode(":", $time);
      $hr = $time[0];
      $min = $time[1];
      $sec = $time[2];
      $y = $date[0];
      $m = $date[1];
      $d = $date[2];
      $lastloginmk = (int)mktime($hr, $min, $sec, $m, $d, $y);
      echo " - ".$lastloginmk;
      if($lastloginmk &lt;= $houraway) { echo "yes"; } else { echo "no"; }
      echo "&lt;br /&gt;";
  }
  </code></pre>
  
  <p>last activity time is stored in the database like this:</p>
  
  <pre><code>2009-09-22 13:32:28
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p>Ryan</p>