In my CakePHP application, I drag out the results of a table called Schedules. This table has an athlete_id and several splits for the race. I need to make some calculations at one time of an athlete compared to another athlete (for example, to calculate the difference between the fastest ending time and the slowest).
I thought the best way to do this is to save all the athletes tokens in a new array, and then run the min () function on it. For the life of me I cannot make it work ...
Do you think I'm approaching this wrong, or am I just missing something?
foreach ($timesheet['Run'] as $run):
<tr<?php echo $class;?>>
<td><?php echo $run['athlete_id'];?></td>
<td><?php echo $run['start'];?></td>
<td><?php echo $run['split1'];?></td>
<td><?php echo $run['split2'];?></td>
<td><?php echo $run['split3'];?></td>
<td><?php echo $run['split4'];?></td>
<td><?php echo $run['split5'];?></td>
<td><?php echo $run['split6'];?></td>
<td><?php echo $run['finish'];?></td>
</tr>
endforeach
source
share