Hi Guys.
I'm creating an application for a friend to handle Deadlines. I have a page set up where each user can see their own 'jobs to do' with a deadline next to it. My question is...
How do I compare a deadline date that comes back from the mysql query as 2010.08.08 with today's date?
For Example...
<?php
while($row = mysql_fetch_array($result)){
$jobfinishdate = $row['jobfinishdate'];
$date = date('Y-m-d');
if ($jobfinishdate>$date)
$jobfinishdate .= " - Not due yet!" ;
else if ($jobfinishdate<$date)
$jobfinishdate .= " - You didn't meet this deadline!";
else if ($jobfinishdate==$date)
$jobfinishdate .= " - Deadline is TODAY!";
} ?>
This works ok. But what I'd really like to do is display a message saying 'you have 5 days until deadline. Any ideas how to get around this?
Thanks.
Shane.