Jump to content

adding total time in a column.


naveendk.55

Recommended Posts

I have a column with time in HH:MM:SS format.  How to add the total time in this column?

 

I tried the below steps but o/p display only 1..

 


$qry = "select SEC_TO_TIME(SUM(TIME_TO_SEC(time_utilization))) from tracker"; 
$result=mysql_query($qry) or die (mysql_error());
$row = mysql_num_rows($result); 



echo $row;  

Link to comment
https://forums.phpfreaks.com/topic/251937-adding-total-time-in-a-column/
Share on other sites

Below is the my code. If the error is resolved, then I'll put the code in the program to get full result. If it display the total, then I'll be able to resolve it. Below is the full code in my page except database connection include file.

 

 

$qry = "SELECT SEC_TO_TIME(SUM(SECOND(time_utilization))) FROM tracker";

$result=mysql_query($qry) or die (mysql_error());

$row = mysql_fetch_array($result);

 

 

echo $row; 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.