I want to compare a db column which stores time in format 09:30:14 against a php variable which stores time in same format.I want to check whether the time stored in dbcolumn is less than 2 miutes of time stored in php using mysql.I want to retireve some values based on this check
$ordertime_present = 09:32:14;
$ordertime_before = 09:30:14;
$sql = "select count(keyid) as key_id_count from key_master where orderdate='$orderdate'
and ordertime between '$ordertime_present' and '$ordertime_before'";