while (@row = $sth->fetchrow()){ $total_minutes = $row[5]; $total_hours = $row[4] * 60; #multiply hours by 60 to get minutes $all_minutes = $total_hours + $total_minutes; $total_time = $total_time + $all_minutes; $total_time_hours += int($total_time / 60); $total_time_minutes = $total_time % 60; $all_time = "$total_time_hours:$total_time_minutes"; ## Make our HTML look better if no data. $row[0] = " " if($row[0] eq ""); $row[1] = " " if($row[1] eq ""); $row[2] = " " if($row[2] eq ""); $row[3] = " " if($row[3] eq ""); $row[4] = " " if($row[4] eq ""); $row[5] = " " if($row[5] eq ""); $row[6] = " " if($row[6] eq ""); @date_array01 = split(/ /,$row[2]); $print_date = $date_array01[0]; $in_time_sec = $date_array01[1]; @in_time_array = split(/:/,$in_time_sec); $in_time = join(":",$in_time_array[0],$in_time_array[1]); @date_array02 = split(/ /,$row[3]); $out_time_sec = $date_array02[1]; @out_time_array = split(/:/,$out_time_sec); $out_time = join(":",$out_time_array[0],$out_time_array[1]); print <