I\'m having trouble trying to get a nested < ul > inside of a while loop. I\'m not sure if this even possible so i\'m open to alternatives.
Here\'s a quick image of w
Update your while
loop to the following:
while ($row = $result->fetch_assoc()) {
if($row['drinks_category_id'] != $last_category) {
if($last_category != 0) echo '';
echo "" . $row['drinks_category_title'] . "
";
echo "";
}
echo "- " . $row['drink_name'] . "
";
$last_category = $row['drinks_category_id'];
}
if($last_category != 0) echo "
";