Jnerocorp Posted November 2, 2009 Share Posted November 2, 2009 Hello, Is it possible for php/mysql to check if the timestamp in a row/table is older than 7 days the timestamp looks like this: 2009-11-01 20:05:18 in table "tokens" -John Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted November 2, 2009 Share Posted November 2, 2009 this should do it if($timestamp < date("Y-m-d H:i:s",strtotime("-7 Days"))); { } Quote Link to comment Share on other sites More sharing options...
MadTechie Posted November 2, 2009 Share Posted November 2, 2009 or MySQL SELECT *,DATE_ADD(TimeStampField, INTERVAL 7 DAYS) > NOW() as Over7Days FROM tokens if($row['Over7Days']){ echo "Over 7 days"; } Quote Link to comment Share on other sites More sharing options...
Jnerocorp Posted November 2, 2009 Author Share Posted November 2, 2009 thanks guys Quote Link to comment Share on other sites More sharing options...
MadTechie Posted November 2, 2009 Share Posted November 2, 2009 Solved ? if so please click topic solved! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.