sami
04-25-2007, 09:13 PM
I have an issue that’s been driving me crazy.
Here is how:
I used db to store the dir path and dir id.
dir_table
dir_id e.g. 1 (my first folder dir id)
dir_name e.g. folder1
dir_path e.g. localhost/upload/folder1
dir_id e.g. 2 (my second folder dir id)
dir_name e.g. folder2
dir_path e.g. localhost/upload/folder2
file_table
file_id e.g. 1 (my first folder dir id)
file_name e.g. file1
file_dir_id e.g. 1 (This first file belong to dir 1)
file_dir_path e.g. localhost/upload/folder1
I was able to call upon the db tables successfully. I see the file1 with a url that I can click to edit it. Once I click to edit the file1…I have the option to delete, edit, and move in the drop down menu. I selected file1 to move to folders2 from folder1. But somehow, the db only updates the file_dir_id from 1 to 2 and NOT file_dir_path.
Now I have this showing in my db file_table:
file_dir_id e.g. 2 (it is belong to dir 2 now)
file_dir_path e.g. localhost/upload/folder1 (file is still in folder1…should be folder2)
This is weird here. I was able to select the same file1 and move it back to folder1 from folder id 2 in the db but there’s no file1 in folder2 directory. It then moved the file1 from folder1 dir and place it in folder2 dir and the file_dir_path is now localhost/upload/folder1. when I tried to get the file again to move…there’s no more file but errors.
I used rename() to move my file.
If anyone understood what I am talking about, please help.
Thanks.
Here is how:
I used db to store the dir path and dir id.
dir_table
dir_id e.g. 1 (my first folder dir id)
dir_name e.g. folder1
dir_path e.g. localhost/upload/folder1
dir_id e.g. 2 (my second folder dir id)
dir_name e.g. folder2
dir_path e.g. localhost/upload/folder2
file_table
file_id e.g. 1 (my first folder dir id)
file_name e.g. file1
file_dir_id e.g. 1 (This first file belong to dir 1)
file_dir_path e.g. localhost/upload/folder1
I was able to call upon the db tables successfully. I see the file1 with a url that I can click to edit it. Once I click to edit the file1…I have the option to delete, edit, and move in the drop down menu. I selected file1 to move to folders2 from folder1. But somehow, the db only updates the file_dir_id from 1 to 2 and NOT file_dir_path.
Now I have this showing in my db file_table:
file_dir_id e.g. 2 (it is belong to dir 2 now)
file_dir_path e.g. localhost/upload/folder1 (file is still in folder1…should be folder2)
This is weird here. I was able to select the same file1 and move it back to folder1 from folder id 2 in the db but there’s no file1 in folder2 directory. It then moved the file1 from folder1 dir and place it in folder2 dir and the file_dir_path is now localhost/upload/folder1. when I tried to get the file again to move…there’s no more file but errors.
I used rename() to move my file.
If anyone understood what I am talking about, please help.
Thanks.