probably a confusing title - I did find one result in the S.O. archives that I thought would do the trick but still not getting it.
I'm using a function to display all files (to me as an admin) in a directory on the server (this works fine) I also have filenames stored in a database table...
what I want to do is; while im generating the server file list, also query the table for a matching filename - I'm trying to identify orphans on the server that are not in my db table.
It's seems like I've done this before or it's "easy" task with a query but I'm drawing a total blank and hitting a wall. (if there's not a result for a row, your basic query just looks for the next match and I want to flag the non-matches).
the one solution I found in the S.O. archives is using "NOT IN" the query something like:
$files_on_server = "file1,file3,file4,file7";
// Your SQL WHERE clause...
...WHERE `filename` NOT IN ($files_in_server)
but that's not doing it for me. thanks in advance for any suggestions.
NOT INis probably easiest approach. What is not working?NOT INshows me titles in the DB that are not in my server file-list that I create. I was looking for the opposite... something like (psuedo) "look for file1 in the DB table... no match but flag that there was no match for "file1" in the db table... look for file2... and so on