title: Update Database upto 24 hours
body: <p>I'm trying to make a hit counter where I want to collect total hits for 24 hours. This 24 hours should be a fixed value regardless to the end user's time zone. Within 24 hours the database should be updated with +1 hit counts and once the 24 hour time scale achieved the timer should be reset.</p>
  
  <p>Here is what I'm trying:</p>
  
  <pre><code>$timer = TIME_NOW - 60*60*24;
  if ($timer &lt; TIME_NOW)
  
      $db-&gt;query("UPDATE settings SET value=value+1 WHERE name='hits_today'");
  }
  else
  {
      $db-&gt;query("UPDATE settings SET value=0 WHERE name='hits_today'");
  }
  </code></pre>
  
  <p>Here <code>TIME_NOW</code> is a constant defined as <code>time()</code></p>
  
  <p>I've searched alot this site but I didn't find any answer to this question, please help, how can I go about this?</p>
  
  <p>Thanks!</p>