Hi And thanks in advance.
I'm rather new to php and have a mental block on this. I've looked all over the place in the forum and also checked the manual. I'm at the stage now where I'm just confused! LOL.
What I have are two seperate times that I would like to add. Simple enough, but I can't get the format to display the result correctly. When I add the results, I get the correct sum but the format changes from 00:00:00 to 0000. eg. 1000:30:00 + 222:00:00 = 1222:30:00 but in the output it becomes 1222. Only the hrs are displayed. Both fields are in time format too.
Here is the code I'm working with.
$query_hours = "SELECT sec_to_time(sum(time_to_sec(t2.duration))) AS duration_sum FROM pilots t1, reports t2 WHERE t1.id=$id AND t1.id=t2.id";
$result_hours = mysql_query($query_hours);
$base = $hrs_brought;
if (mysql_numrows($result_hours) > 0) {
$time = mysql_result($result_hours,0,"duration_sum");
$total = $base + $time;
The idea behind this is as new members join, they can bring in their existing hrs. Thus the reason for the $base.
the output is this:
print "<td height=12 align=right><font face=Arial size=2 color=#000080>$total</font></td>";
Can some one point me in the right direction, that would be great.
Cheers
Steph.