Jump to content

[SOLVED] Query Multiple Levels Deep


dprichard

Recommended Posts

I have a database with a table for folders that can have subfolders.  It is setup like this

 

FolderID

FolderName

SubFolderID

 

If the user puts something in the main folder it is given a SubFolderID of 1.  Anything else is given a SubFolderID of whatever folder it goes into. 

 

They can put documents into each of these folders and they are saved in a document table.

 

DocumentID

DocumentName

DocumentFolderID

 

I am trying to figure out how I can have a query for just the main level of documents that shows the number of documents under that category going all the way down into the sub folders.  Since the sub folders can potentially go down infinitely, I am having a little trouble figuring out how to do this.  Any help would be GREATLY appreciated.

 

Thank you!!!!!!!!!!!!!!!!!!!!!!

Link to comment
https://forums.phpfreaks.com/topic/62691-solved-query-multiple-levels-deep/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.