Code: Select all
while ($Problem_List = mysql_fetch_array($Query_Result))
{
$All_Items .= " - " . $Problem_List[ItemNo];
if($Problem_List[ItemNo] != $Current_ItemNo)
// if this is not the same item number we've been handling thus far, we need to start over with new formatting.
{
include_once 'list_item.html';
$Current_ItemNo = $Problem_List[ItemNo];
}
else
// if we've already started displaying this item, just append individual problems to it now
{
echo "<strong>$Problem_List[ProblemType]</strong>, ";
}
}Obviously, the first time through, the ItemNo tracking variable has not yet been set, so we start a new row. Great. Next time through, we append a line of text, since the itemNo still matches. All working as it should. But, say that now on the 3rd record, we have a different ItemNo. It should be generating a new row. And yet... it's not. It continues to append strong text to the end. I've even echoed out the ItemNo variables, and they are indeed changing, yet no new rows ever get created.
This is bang-head-on-wall material here.