I've got a list of accumulated hours stored in a MySQL db which I'd like to add together. They're stored as Time type.
So if I have:
01:30:00
01:30:00
I'd like to be able to total them up to 3 hours.
I've been attempting to use a Select query to do the work for me but it's not producing what I want.
Here's the query bit:
Code: Select all
$result = @mysql_query("SELECT SUM(flight_time) as totalflighttime7 from log WHERE date BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 7 DAY ) AND CURDATE( ) ");So for the above example I'm actually getting 26000 returned (which I assume is 02:60:00) whereas what I want is 03:00:00.
Can anyone point me in the right direction? Should I be using PHP instead of the above select query?
Thanks