Welcome Guest, Not a member yet? Register   Sign In
Need help: dynamic menus from database entries
#5

[eluser]WanWizard[/eluser]
Google on "mysql nested tree", you'll be amazed at what's out there...

You are approaching the problem from the wrong end. Just because you have a hierarchy ( a tree ) in your output doesn't mean your internal variable structure should reflect that. You make it overly complex.

You are starting from a flat structure (i.e. the result of a query), just loop through the results, keep track of the current tree depth, and generate the html accordingly. Remember, the end result (the html) is flat as well.


Messages In This Thread
Need help: dynamic menus from database entries - by El Forum - 08-05-2010, 02:22 PM
Need help: dynamic menus from database entries - by El Forum - 08-05-2010, 03:01 PM
Need help: dynamic menus from database entries - by El Forum - 08-05-2010, 10:12 PM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 12:52 AM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 03:49 AM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 05:09 PM
Need help: dynamic menus from database entries - by El Forum - 08-06-2010, 11:39 PM
Need help: dynamic menus from database entries - by El Forum - 08-07-2010, 12:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB