9
A better way to fix this than just "deleting" the LIMIT condition is to add a check to see if $newclassifieds is set - then just branch around the code that counts on it because there isn't any reason to execute the code anyway if there aren't any new classified ads.
So put this on line 39 (currently an empty line):
if (isset($newclassifieds)) {
and then add this to line 56 (also a empty line):
}