Thanks to nvmobious but I'm still frustrated, however I do appreciate your help. (although it shows how much farther I have to go just to code simple things)
I don't think I adequately explained my problem, OR I'm too dumb to figure this out.
what I have is approx 15,000 images on one folder in the server - call it //disk2/images
and I have about 300,000 images in a database - call it imagedb
I need to take each image in the disk2 server images folder and search the imagedb until I find a match. When I find the match I have to grab the path that is attached to it so my query for that part has to have image and path in it. After images are matched then I have to check the patch to see if the file exists, if it does move on to the next and if it doesn't then copy the image from disk2 to the path that I grabed from the server and then move on to the next one.
if there is no match then I want to keep a log of that so I can manually check those images to find out what the problem is.
I've looked through the code and tried to use it, I tried to use my own code which I had figured out how to pull the image numbers locally and pull the image number from the database locally but I can't get the compare and copy to work...