I have table named notify with (seeker, donor, date) columns   

the date column of type (datetime) and it stores the following format YYYY-MM-DD HH:MM:SS   

 I'm trying to SELECT 1 record with the latest date from notify table and then compare the date with the current date and calculate the number of days between tow dates.. 

```
<?php

session_start();
$email = $_GET['email'];
date_default_timezone_set('Asia/Riyadh');
$time = date("Y-m-d H:i:s");

$note = "SELECT * FROM notify WHERE seeker='".$_SESSION['email']."'AND donor='".$email."' ORDER_BY `date` DESC LIMIT 1";
$st = $conn->prepare($note);
$st->execute();

if($found = $st->fetch(PDO::FETCH_ASSOC)){
    $now = $time;
    $old_date = strtotime($found['date']);
    $dateif = $now - $old_date;

    if(floor($dateif/(60*60*24)) >= 7){
    echo "the difference between tow dates is 7 days or more";
    } else { echo "difference between tow dates is less than 7 days";}
}
?>

```

 the code is not working !   
 i have only one record in my notify table with this value in date 2013-04-22 09:15:47