Hi everyone,
I am trying to figure out the way to check if the file ,that exists on a filestore, is also present in the database. Ultimately i want to flag up the files that exist in the database but are not on the filestore and vice versa.

I have already implemented the bit where it checks if the documents, or more specifically the link to the documents, in database match with the one on filestore directory path. I accomplished it with PHP and MySQL.

But , i am not sure how i can get the path of the document from filestore and check it with the links on the database.

The reason i need to do that is: people/employees can add documents to both filestore and database but there is no check whether the document that exists on a filestore is also entered in the database. I hope you understand my problem and will be able to give me some sort of direction. PHP solution only please.


I know i can use file_exists() to check if a particular (single) file exists in PHP but the problem is how i can basically go through hundreds of file in the directory automatically.

I put everything in the while loop when i implemented the bit where it read info from database row by row... but how to to do similar thing when i dont have any thing such as database to play with..HELPPPPPP