$toplusay = $db->QueryFetchArrayAll("SELECT count(id) as say FROM `youtube` WHERE `user`='1' and active=0");
if($toplusay['say']<21)
{
$toplus = $db->QueryFetchArrayAll("SELECT id, active FROM `youtube` WHERE `user`='1' order by id desc limit 20");
foreach($toplus as $toplu)
{
$db->Query("UPDATE youtube SET active=0 WHERE `user`='1' and id='".$toplu['id']."'");
}
}