title: Removing rows from MySQL table where the timestamp is over one day old?
body: <p>I found the exact same question <a href="https://stackoverflow.com/questions/2136674/get-rows-where-timestamp-column-is-2-days-old">here</a>.</p>
  <p>But it isn't working for me. I've modified it a bit, manipulated it, and I can't figure it out. I'm trying to remove rows that are over a day old. Here is my code:</p>
  <pre><code>if (isset($_POST['prune'])) {
  
      $sql = &quot;DELETE FROM logs WHERE time &lt; date('now', '-1 days')&quot;;
      mysql_query($sql);
      
      echo 'Logs older than one day removed.';    
  
      }
  </code></pre>
  <p>Fairly simple question I suppose, but its bugging the hell out of me. I would appreciate any help.</p>
  <p>In case it makes a difference, the column is a <code>TIMESTAMP</code> type.</p>
  <p><strong>EDIT:</strong> Apparently I'm an idiot. The question I linked you to relates to SQLite3. So now my question is, how can I do this in MySQL?</p>