Problem in Time

Discussion in 'PHP' started by newphpcoder, Feb 1, 2012.

  1. #1
    Hi..


    I got an issue in getting the total time.

    I have this code to get the sum of total time:

    
    $result = mysql_query("INSERT INTO payroll.casual_hours(EMP_NO, Hours) SELECT EMP_NO, sec_to_time(SUM(time_to_sec(Rendered))) FROM payroll.casual_att WHERE DATE_FORMAT(LOGOUT, '%W') IN ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday') GROUP BY EMP_NO") or die(mysql_error()); 
    
    Code (markup):
    Rendered:
    09:00:00
    09:00:00
    09:00:00
    08:00:00
    08:00:00
    07:48:00

    and the result of this is 50:48

    but I need result is 50:80

    the minutes is divided to 60

    Is there any way to get the 50:80 result.


    Thank you so much..
     
    newphpcoder, Feb 1, 2012 IP
  2. earnnet

    earnnet Member

    Messages:
    100
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #2
    You'd better head to the MySQL section as this question has nothing more than few chars to do with php
     
    earnnet, Feb 2, 2012 IP