0
I have a table ''category'' in the database and it has the column 'id' and 'title', I am recovering the same in several menu’s dropdown, but loads all categories of the database but I would like to load each category in its respective menu, someone could help me?
From now on, thank you very much!
<ul>
<li class="drop-menu">
<span class="menu-item">Teste 1 <i class="fas fa-caret-down"></i></span>
<ul class="submenu">
<?php
foreach($categorias as $categoria){
?>
<li><a href="<?php echo base_url
('categoria/'.$categoria->id.'/'.limpar($categoria->titulo)) ?>"><?php echo $categoria->titulo ?></a></li>
<?php
}
?>
</ul>
</li>
<li class="drop-menu">
<span class="menu-item">Teste 2 <i class="fas fa-caret-down"></i></span>
<ul class="submenu">
<?php
foreach($categorias as $categoria){
?>
<li><a href="<?php echo base_url
('categoria/'.$categoria->id.'/'.limpar($categoria->titulo)) ?>"><?php echo $categoria->titulo ?></a></li>
<?php
}
?>
</ul>
</li>
</ul>
You could inform the queries you make to generate this $categories array ?
– Rafael Simionato Hayashi