WHERE creation_date < '$creation' AND (last_visit < '$access' OR last_visit is NULL) ".
WHERE creation_date < '$creation' AND (last_visit < '$access' OR last_visit IS NULL) ".
// Change this line to avoid deleting specifi courses
// Set course codes and uncomment the next line to exclude these from deletion
// "AND c.code NOT IN ('CHAMILOTEACHER', 'CHAMILOADMIN') ".
// " AND c.code NOT IN ('CHAMILOSESSIONS1ES','CHACOBU1ESPRE','CHAPA1ESPRE','CHAPA1FRX','CHACOBU1FRX','CHAPA1ESX','CHACOBU1ESX','DESIGNCHAMILO','EXELEARNING','CHAPA1ENX','CHACOBU1ENX') ".
echo "[$count] Course ".$item['code'].'('.$item['id'].') created on '.$item['creation_date'].' and last used on '.$item['last_visit'].' uses '.$size.PHP_EOL;
echo "[$count] Course ".$item['code'].'('.$item['id'].') created on '.$item['creation_date'].' and last used on '.$item['last_visit'].' uses '.$size.PHP_EOL;