Jump to content

countdown from time in database


techker

Recommended Posts

hey guys  im made a scanning system that when the member scans his id card it gets info from the databse

 

nam and if there is a message in his file.

 

i want to add an alert like there is x day's left to the end of your contract..

 

i have in the databse the created date and the end date.

 

how can i calculate the remeinder of days ?

Link to comment
Share on other sites

i found this but i can't seem to modify it for me?

 

function countdown($event,$month,$day,$year) {
// subtract desired date from current date and give an answer in terms of days
$remain = ceil((mktime(0,0,0,$month,$day,$year) - time()) / 86400);
// show the number of days left
if ($remain > 0) {
print "<p><strong>$remain</strong> more sleeps until $event</p>";
}
// if the event has arrived, say so!
else {
print "<p>$event has arrived!</p>";
}
}

// call the function
countdown("Christmas Day", 12, 25, 2008);  

Link to comment
Share on other sites

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.