I know how to only return a row with a date older than 30 days in a mySQL query, but I’m uncertain how to do it in PHP. How do I write an IF statement that is similar to this following?
Get the current timestamp in seconds and subtract the stored timestamp (converted to a timestamp in seconds). If that is greater than 30 days (in seconds), then do stuff.
Just make sure the timezone of the current time and the stored time are the same.
That’s the same code. It just doesn’t have all the logic in a single line. It might be easier to understand this way if my example code didn’t make sense.