hmm, then the error seems a bit confusing to me...
maybe you can try this:
instead of
PHP Code:
$DB_site->query('DELETE FROM cache_forumhome WHERE userid=' . $bbuserinfo[userid] . iif($numbersmembers['lastpost']>(time()-3600*5), ' OR lastpost<'.(time()-3600*5),''));
use smaller values as the timespan:
PHP Code:
$DB_site->query('DELETE FROM cache_forumhome WHERE userid=' . $bbuserinfo[userid] . iif($numbersmembers['lastpost']>(time()-3600*3), ' OR lastpost<'.(time()-3600*3),''));