I am creating a traceability matrix for PRD. I have test case _id which is coming as row of the tables. And requirement id is coming as my column. I using php table creation..
this is the code i am using
<th>Requirement:</th>
</tr>
<?php
foreach($q['cases'] as $case)
{
echo "<tr>";
echo "<td>".$case['requirement_id']."</td>";
foreach($q['cases'] as $case)
{
//echo "<td> </td>";
for($i=0;$i<count($case['id']);$i++)
{
if($case['requirement_id']==true)
echo "<td>OK</td>";
}
}
echo "</tr>";
}
?>
i want to do check a “ok” mark per case_id ..I mean if there is a requirement_id corresponding to a case_id then only “ok” mark ll be there else blank.
so according to my program each line will have only one “ok” , not every cell.
Try this:
The problem was that you were calling two foreach loops with the same variable name
$caseand that might got confused.