Hey, just need a little help on this one. I have a script allows a user to choose from a list of files in a directory for a form. When they submit the form, it adds the files name and url to a couple fields in the database for that entry.
What I need to do is every now and then, I need to see if any of the files in that directory are currently in use in any records in the database. In other words, I need to compare each of the file names with the column "file_name" in my database, and test to see if there are any matches. This way I will be able to clean out any old, unused files.
If the query returns no results for any one of the files, I'll know I can delete that file.