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.
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:
$q = "SELECT * FROM conversion_data WHERE ip='$ip' AND timestamp < DATEADD(HOUR, -1, CURRENT_TIMESTAMP) ";
Taking out the timestamp call, it all works fine, so it’s just that one part.
Thanks!
Try: