Jump to content

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!';
    }
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.