title: mySQL Select records within past hour
body: <p>I'm setting up basic cookie tracking and validating that by making sure the cookie is on their computer AND their IP matches the record I stored AND the record was stored within the past hour.  I'm getting hung up on selecting the mySQL data from within the past hour.</p>
  
  <p>As it stands, the column in my table is called 'timestamp', and it just contains the full timestamp inserted with NOW().  I checked around and thought I found the right call, but this didn't work:</p>
  
  <pre><code>$q = "SELECT * FROM conversion_data WHERE ip='$ip' AND timestamp &lt; DATEADD(HOUR, -1, CURRENT_TIMESTAMP) ";
  </code></pre>
  
  <p>Taking out the timestamp call, it all works fine, so it's just that one part.</p>
  
  <p>Thanks!</p>