Hi, in my database i have a table which stores a directory structure
folderstructure table
id, foldername, parentid
parentid points to its parents "id" (
)
i need to retrieve this info so that its sorted by foldername and its children are listed below also sorted by foldername; there can be a infinite amount of nested folders.... im not really sure how to go about this; i was hoping that maybe theres some magical sql statement that can do this for me
i sort of dont want to put this info in a array then sort it with recursion (which i tried and failed), nor do i want loads of sql queries
tia
folderstructure table
id, foldername, parentid
parentid points to its parents "id" (

i need to retrieve this info so that its sorted by foldername and its children are listed below also sorted by foldername; there can be a infinite amount of nested folders.... im not really sure how to go about this; i was hoping that maybe theres some magical sql statement that can do this for me
i sort of dont want to put this info in a array then sort it with recursion (which i tried and failed), nor do i want loads of sql queries
tia
Comment