What's wrong with this for loop?
Posted: Thu Jan 08, 2009 8:07 am
Hi there, can anyone help me with this bit of code?
The loop below should display data from three entries in the "task" table. Instead, it displays nothing. To debug, I tried to echo $b. Again, nothing?!
Echoing $summary['Task'][0]['due_date'] works as expected, by the way.
Why is nothing being displayed?
Thanks
The loop below should display data from three entries in the "task" table. Instead, it displays nothing. To debug, I tried to echo $b. Again, nothing?!
Echoing $summary['Task'][0]['due_date'] works as expected, by the way.
Why is nothing being displayed?
Thanks
Code: Select all
<?php for ($b=0; $b>=2; $b++):?>
<?php echo $b;?>
<table class="taskTable">
<tr>
<th>Deadline:</th><td <?php echo $taskClass . '>' . $time->format('d-m-Y',$summary['Task'][$b]['due_date']); ?></td>
</tr>
<tr>
<th>Owner:</th>
<td><?php echo $summary['Task'][$b]['task_owner'];?></td>
</tr>
<tr>
<th>Task:</th>
<td><?php echo $summary['Task'][$b]['task_description'];?></td>
</table>
<?php endfor;?>