is the ID from mysql query, parent_id and depth variable
depth starts with 0
Can you give me an elegant solution or a good link
I am using CI
First of all, you should read all the child elements and" Once you get the right size, you can use the following example code to correct the diagram. or You can also do the code below print_list is a recursive function and $ array has all the rows from the database.
function print_list ($ array , $ Parent = 0) {print "& lt; ul & gt;"; Forex currency ($ line as $ line) {if ($ row-> gt; parent_id == $ parent) {Print "
Comments
Post a Comment