<?php
// your first date coming from a mysql database (date fields)
$dateA = '2013-11-11 23:10:30';
// your second date coming from a mysql database (date fields)
$dateB = '2013-11-11 16:27:21';
$timediff = strtotime($dateA) - strtotime($dateB);
if($timediff > 86400){
echo 'more than 24 hours';
}
else
{
echo 'less than 24 hours';
}