Hi! I am building a file/folder tree. I have
id, name, parentid, foldertype;
1, root, 0, 1;
2, folderA, 1, 1;
3, folderB, 1, 1;
4, fileA, 2, 0;
5, fileB, 2, 0;
Foldertype =1 is folder, 0 is file. Because fileA and fileB belongs to folderA which is parentid = 2, I want to have it appear immediately after folder A. ie. I want to have something like this:
1, root, 0, 1;
2, folderA, 1, 1;
4, fileA, 2, 0;
5, fileB, 2, 0;
3, folderB, 1, 1;
Is it possible? How? Thanks.