I am trying to do dynamic nav menus for the pages, when admin creates a page, he selects multiple selection for the menus that this page should appears for,
I am achieving this through two steps, 1st step adding the selected menus in the database separated by commas using implode(",", $assignNav) "1st step works successfully", 2nd step SELECT query using FIND_IN_SET() to match values in the separated commas.
Result in 2nd step: Just menus without commas "Assigned 1 value" is selected normally, but any pages with commas "assigned multiple values" did not return any output.
2nd Step Query:
<?php
$query = mysqli_query($dbConnection,"SELECT menu_name FROM navigation_menus WHERE FIND_IN_SET('3',menu_link_id) ");
queryConfirm($query);
while($row = mysqli_fetch_assoc($query)){
$menu_name = escape($row['menu_name']);
?>
<h6 class="mb-0 text-sm"><?php echo htmlspecialchars($menu_name); ?></h6>
<?php
}
?>
so I'm trying now to output menu_name which contains id 3 from menu_link_id – wowoffer Sep 02 '22 at 09:46