0
I am developing a project in PHP and Mysql, and would like to create a menu that shows the categories registered in a database.
In this case I have two related tables whose names are tbl_categorias
and tbl_subcategorias
, which have the following fields:
tbl_categoria
categoria_id | categoria
----------------------------
1 | Aço e Metais
===================================
tbl_subcategoria
subcategoria_id | subcategoria | categoria_fk
-----------------------------------------------
1 | Ferro | 1
How can I create a menu (categories) that also contains a submenu (subcategories) in PHP? At first I’m trying to create a PHP code to insert it into the HTML tags below:
<ul>
<li></li>
</ul>
How can I proceed?
Hi Julio. Thanks for the return. I will implement and adjust the above code as needed. Thanks!
– Michel