Hi All,
I can't figure out how to deal with the following case.
I have a mysql table with 8 columns containing the names of 8 files located in a folder on the server. It doesn't necessarily have to be that 1 mysql row has all 8 colums filled which means that not all 8 files have been uploaded. I have a page where one can add/modify (replace the existing file for a new one) or delete these files through an upload script. This is working fine.
What I need is that when a file has been deleted, all files below that file move up 1 (if file 5 is deleted, 6 becomes 5, 7 becomes 6 and 8 becomes 7, etc). Which means that the mysql row needs to be updated and the names of the particular files on the server aswell. The values of the myswl rows are resp 1,2,3,4,5,6,7,8 for each column. the file names are the id of the mysql row with "_" added and 1 of the numbers 1 to 8.
I can't figure how to efficiently deal with this. One should check if and which new files have been uploaded, which files have been replaced with new files and which files have been deleted. Ending with a consecutive row of files without "gaps" properly named on the server so it can be referenced through the mysql table.
I hope anyone understands what I am trying to do and knows of a good solution.
Thanks,