Hello. I have a query that is returning an array like so:
while($row = $result->fetch_array(MYSQLI_ASSOC))
{
$row = array_map('stripslashes', $row);
$dataArray[] = $row;
}
}
return $dataArray;
I use a for each to print all the returned values and this is what I get as results:
As you can see I have the same class id and name repeated, because how I am getting the data with the sql query. Basically I want the class id and name to be printed once one in my top table.
I tried this outside the foreach:
<tr>
<td>" . $array['class_id'] . "</td>
<td>" . $array['class_name'] . "</td>
</tr>
How can I get this done?