Thanks motto,
I still can't get it, I should had provide more. I am really stuck, I guess some different opinions and suggestion, since I had work on it for days.
here is the quote
//-------------------------------------
for($i=0; $i<$numDay; $i++) { // loop number of days selected by user on any selected date, month or year
$thisDay=date('Y-m-d', mktime(0,0,0,$thisMonthStart, $thisDayStart+$i, $thisYearStart));
$scoreDaily=array();
$scoreWeekly=array();
foreach($thisCard as $key=>$val) {
$query_3="SELECT score FROM report_manhours WHERE cardnumber='$val' AND date='$thisDay' ";
$result_3= $mysqld -> query($query_3);
if ($result_3==true) {
if(mysql_num_rows($result_3)>=1) {
while($rows_3=mysql_fetch_row($result_3)) {
$scoreDaily[] = $rows_3[0];
}//endwhile
}//endif
}//endifresult_3
}//endforeach
if($numDay==1) {
echo(countDailyScore($score)); // TOTAL SCORE PER DAY ;
}else{
$dayScore[$i]= (countDailyScore($score));
if(!empty($dayScore[$i])) {
echo(substr($days[$i],0,3).':'.$dayScore[$i]);
if(!isset($mins)) {
$mins='';
}
$parts = explode(':', $dayScore[$i]);
$mins[$i] += $parts[0]*60 + $parts[1];
}
}