I am at the internship and I am developing a HTML table that has milestones and milestoneparts(in this project we call it milestonefase). Each milestone has a bunch of milestonefases.
As example: Milestone99 has milestonefase 10, milestonefase14.
Those data come from two diffrent database tables. My array looks like this:
Array
(
[milestonesfases] => Array
(
[10] => Array
(
[milestonefase_id] => int
[milestonefase_titel] => string
[milestonefase_milestone_id] => int
)
[14] => Array
(
[milestonefase_id] => int
[milestonefase_titel] => string
[milestonefase_milestone_id] => int
)
)
[milestone_id] => int
[milestone_titel] => string
[client] => string
[milestone_verkocht_id] => int
)
My question is: How can I loop trough all milestonefases that is connected with milestone 6 (in this case)
My loop looks like this:
foreach ($stones as $milestone)
{
echo '<tr id="'. $milestone['milestone_id'] . '" class="milestone'. $milestone['milestone_id'] . '">';
echo '<td>'. $milestone['milestone_id'] . '</td>';
echo '<td><a href="javascript:keuzeGebruiker(\'milestone'.$milestone['milestone_id']. '\',\''.$milestone['milestone_id'].'\');">' . $milestone['milestone_titel'] . '</a></td>';
echo '<td>'. $milestone['client'] . '</td>';
echo '</tr>';
for ($i = 0; $i < count($milestone['milestonesfases']); $i++)
{
echo '<tr>';
echo '<td>'. $milestone['milestonesfases']['milestonefase_id'] . '</td>';
echo '<td>'. $milestone['milestonesfases'][10]['milestonefase_titel'] . '</td>';
echo '<td></td>';
echo '</tr>';
}
}
That '10' in my loop needs to be all milestonefase_id's (which is 10, 11, 12, 13, 14, 15 in this milestone).
How can I manage to get all milestonefases.
Attention! it must work for every milestones not only this please
That piece of milestones works but milestonefases does not work.