1<?php
2
3$req = Sql_Query(sprintf('select l.id from %s l left join %s lu on l.id = lu.listid where lu.userid is null',$GLOBALS['tables']['list'],$GLOBALS['tables']['listuser']));
4$count = Sql_Affected_Rows();
5$status = s('%d lists deleted ',$count);
6while ($row = Sql_Fetch_Row($req)) {
7    Sql_Query(sprintf('delete from %s where id = %d', $GLOBALS['tables']['list'],$row[0]));
8}
9