I have a upload script with virtual folder structure (so no actual structure) linked to a user. So i can make a different structure for every user.
This structure is (only) saved in the database. And files are linked in the database but are all saved in one folder. But now i want to copy a complete structure to another user. The structure can have infinite sub folders.
The database looks something like:
id | user | parent | name
1 | 6 | 0 | Folder 1
2 | 6 | 0 | Folder 2
3 | 6 | 1 | Sub of Folder 1
4 | 6 | 1 | 2nd Sub of Folder 1
5 | 6 | 2 | Sub of Folder 2
6 | 6 | 3 | Sub of Sub of Folder 1
7 | 6 | 6 | Sub of Sub of Sub of Folder 1
What is the best way to copy this to another user? Is it possible with just mysql?
(Keep in mind that id is auto increment index and parent refers to id) Hope someone can help.