I want to list a table record and display the sum of reported times, but I can not.
The reports table has the field registration and duration
registration duration
2501 00:40:00(timestamp)
2501 01:20:00(timestamp)
5531 01:20:00(timestamp)
I want to list the duration of each registration
$hours = mysql_query("SELECT SEC_TO_TIME( SUM( TIME_TO_SEC( duration ) ) ) AS duration_sum FROM reports");
$horas = mysql_result($hours,0,"duration_sum");
while($row=mysql_fetch_row($horas)){
<tr>
<td align="center"><div align="left"><? echo($row[1]); ?></div></a></td>
<td align="center"><div align="center"><? echo($row[2]); ?></div></td>
</tr>
}