Problem: I can't think of way make a recursion function to my specific situation.
Situation:
Mysql DB
id | root | name |
Where root
shows to witch category this is subcategory.
How should HTML look:
<li><a href="#"><p class="Tier0">Datori</p></a>
<ul style="display: block">
<li><a href="#"><p class="Tier1">Cookies</p></a></li>
<li><a href="#"><p class="Tier1">Events</p></a></li>
<li><a href="#"><p class="Tier1">Forms</p></a></li>
<li><a href="#"><p class="Tier1">Games</p></a></li>
<li><a href="#"><p class="Tier1">Images</p></a>
<ul>
<li><a href="#"><p class="Tier2">CSS</p></a></li>
<li><a href="#"><p class="Tier2">JavaScript</p></a></li>
<li><a href="#"><p class="Tier2">JQuery</p></a></li>
</ul>
</li>
<li><a href="#"><p class="Tier1">Navigations</p></a>
<ul>
<li><a href="#"><p class="Tier2">CSS</p></a></li>
<li><a href="#"><p class="Tier2">JavaScript</p></a></li>
<li><a href="#"><p class="Tier2">JQuery</p></a></li>
</ul>
</li>
<li><a href="#"><p class="Tier1">Tabs</p></a></li>
</ul>
</li>
<li><a href="#"><p class="Tier0">Washing Machines</p></a>
What kind of PHP function I would need to print it all out?