jeff5656 Posted November 24, 2010 Share Posted November 24, 2010 I want to see if a date is more than 10 days overdue. if ($row['duedate'] < "todays date plus 10 days"){ How do I do that? I put in quote sup there in "english" what I want... Quote Link to comment Share on other sites More sharing options...
Rifts Posted November 24, 2010 Share Posted November 24, 2010 if ($row['duedate'] < $row['duedate']+10){ Quote Link to comment Share on other sites More sharing options...
jeff5656 Posted November 24, 2010 Author Share Posted November 24, 2010 No that didnt work. That just gives me the number 10. incidentally if I do echo date ("Y-m-d" + 10); I get back "10". Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 24, 2010 Share Posted November 24, 2010 if ($row['duedate'] < $row['duedate']+10){ That won't work. It will always return TRUE. It's the same as saying "if x is less than (x + 10)". Quote Link to comment Share on other sites More sharing options...
jdavidbakr Posted November 24, 2010 Share Posted November 24, 2010 I want to see if a date is more than 10 days overdue. if ($row['duedate'] < "todays date plus 10 days"){ How do I do that? I put in quote sup there in "english" what I want... Assuming $row['duedate'] is a DATE or DATETIME format: if (strtotime($row['duedate']) < strtotime("+10 days")) { ... } 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.