Jump to content

Comparing values help


coupe-r

Recommended Posts

Hey Guys,

 

I have a strtotime() variable inserted into the DB, which serves as an expiration date.  I want to alert the user 7 days before expiration.

 

$next_week = strtotime("+1 week");

 

SELECT COUNT(lease_end_int) FROM tenants WHERE lease_end_int < ' ".$next_week." '

 

lease_end_int is stored as a INTEGER(10) in the DB.. Apparently this is not working.  Any thoughts?

Link to comment
https://forums.phpfreaks.com/topic/199014-comparing-values-help/
Share on other sites

If the expiration is in the db then $row['expiration'] is the expiration in this case.

$expiration = $row['expiration'];
$expiration -=  7 / 24 / 60 / 60;
if(time() > $expiration) {
    if(time() < $row['expiration']) {
        echo 'You have not reached the expiration date yet!';
    }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.