$fetch=mysql_query("select * from code where user_email='$email' order by reg_date desc limit 1");
$db=mysql_fetch_array($fetch);
print_r($db);
$db_date=$db['reg_date'];
$db_time=$db['time'];
echo "DB_Date:".$db_date."--";
echo "DB_time:".$db_time."--";
$current_date = date('Y-m-d');
echo "present date".$current_date."--";
$curent_time = date('H:i:s');
echo "current time:".$curent_time."--";
$first_time = strtotime($curent_time);
$last_time = strtotime($db_time);
$time = $first_time - $last_time;
$time_differenc= ($time/60)%60;
echo "difference".$time_difference."--";
In the above code, i'm getting the present time,date and time,date value stored in the db correctly,but when i tried to find the difference between current time and time stored in the database, i cant get the difference.
When i give the time directly like strtotime('11:30:02'); the difference can be calculated but when i tried to get the time value which is stored in database, i cant!!!
Help me soon!!! I'm trying a lot....