time1: 2013-08-26 16:33:00
time2: 2013-08-26 15:10:00
$query="UPDATE `FlightSchedule`
SET delay = MINUTE(TIMEDIFF(time1, time2))
WHERE `flightNum_arr`='".$flightNum_arr."';";
It saves the value 23 as the delay. Instead the correct answer should be 83 minutes. How to get it?
I think you are looking for:
Alternatively, there is TIME_TO_SEC function - and, since it provides result in seconds, you'll need to divide it to 60 too.