I have a MySQL database in this format :
table name : btree_mst fields : id, parent_id, left_node_id, right_node_id, user_name
Now what I have to do is print it in the Un-ordered list format like below
- Root Node
- Node A
- Node A Left
- Node A Right
- Node B
- Node B Left
- Node B Right
- Node A
I tried to make a recursive function for that but didn't work as expected. Any suggestions ?
Here is the Code I made, http://pastebin.com/X15qAKaA The only bug in this code is, it is printing UL every time. It should print only when the Level is changed.
Thanks in advance.