how to write tree structure query for following table. the table is dynamically add , delete ,edit so that query should be dynamically. In Oracle very easy retrieve the query.
how to retrieve the result using mysql database.
node_id : parent_id : name : type
1 : 0 : root : dir
2 : 1 : P1 : dir
3 : 2 : C1 : file
4 : 2 : C2 : file
5 : 1 : P2 : dir
6 : 5 : C1 : file
7 : 5 : C2 : file
8 : 5 : P2_1 : dir
9 : 8 : P2_1_C1 : file