I have a MySQL table that contains datetime data stored in it.
I need to know if 30 days has passed since the given time.
How can I do this?
Mockup code:
$query = mysql_query("SELECT data FROM myTable LIMIT 1");
$row = mysql_fetch_array($query);
if( days_passed($row['date'], 30) )
echo "30 days has passed since the given date time.";
Answering the question directly, you can use this function in your if statement.
That will return true if the difference between the date provided and now is >= the number of days supplied in the second argument.
However, your may prefer to do this with SQL.