Thanks guys. I delete 500 by 500 now and it takes like 20 seconds only. I am using the manual select where in method. It is great. Now for the files, OK I will use a cron. But can I change the way I get the file names? I mean instead of deleting the photo that is related to a deleted member, can I delete photos that were last accessed a year ago? Lordo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php