title: Totalling up times from a mysql column
body: <p>I am trying to total up all the timesdate seperately from a few different columns in my database, however when the total for each surpasses 24 hours - I'm only getting 00:00 printed instead of the actual total.</p>
  
  <p>I understand that the PHP date "H" variable only cover 00 - 23, so am unsure the best way to go about doing this. Any help would be much appreciated.</p>
  
  <p>My SQL select code is:</p>
  
  <pre><code>SEC_TO_TIME( SUM( TIME_TO_SEC(lunch) ) ) AS lunch, 
  SEC_TO_TIME( SUM( TIME_TO_SEC(overtime) ) ) AS overtime, 
  SEC_TO_TIME( SUM( TIME_TO_SEC(day_paid) ) ) AS day_paid, 
  SEC_TO_TIME( SUM( TIME_TO_SEC(lunch) ) ) AS lunch, 
  SEC_TO_TIME( SUM( TIME_TO_SEC(holiday) ) ) AS holiday, 
  SEC_TO_TIME( SUM( TIME_TO_SEC(absence) ) ) AS absence
  </code></pre>
  
  <p>My view code as an example for "lunch" is:</p>
  
  <pre><code>echo date('H:i', strtotime($day_breakdown-&gt;day_paid);
  </code></pre>