I have hundreds of folders on my site.
and so on ...
each has at least one subfolder
this sub folder has some files ...
I need a script that I could execute at the root / public_html ... and it goes through the list of folders in the folder `files`, copies the folder name, and adds it to my mysql_database table, then goes in and gets the name of the subfolder and enters that in the same row of the table as the parent folder, and the same for the rest of the files.
I am on a short deadline, so need this done ASAP.
If you have any questions, feel free to email me.
The script must be well commented and use functions wherever possible.
- P.S. The number of folders can vary. The script must count the folders and then loop accordingly.
- The script must be crash proof. This means that let's say the script processed 200 folders and then crashed, when we re-execute it it should start from where it left it (to avoid duplicate entries in the database).