Time() math - adding sql results from DIFFTIME

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Consolas
Forum Newbie
Posts: 13
Joined: Wed Apr 09, 2008 7:07 pm

Time() math - adding sql results from DIFFTIME

Post by Consolas »

Hello everyone

I need for a monitorization system, to have a time interval stored.

I have a table with timein and timeout.

What i do is a TIMEDIFF between these both fields. On each fetch() i get the time between both files. Let's have an example:

00:03
00:07
00:25
00:47

What i need is to add all these results into a final one, like 00:01:22, in this example.

I've tried to simply add a $final_result = $final_result + $time_result (this would be the 00:03 ) but the result is 0.

how can i do this? Please, help me..!

thank you very much
Post Reply