$files = mysql_query("SELECT * FROM `download` WHERE `type`='cat' and `refid`='0' ORDER BY `name` ASC;"); echo '
Загрузки - Категории:
'; while ($arr = mysql_fetch_array($files)) {$counter = mysql_query("SELECT COUNT(`id`) FROM `download` where `refid`='".$arr['id']."' and `type`='file'"); $count = mysql_result($counter,0); $time = $realtime - (3 * 24 * 3600); $counter2 = mysql_query("SELECT COUNT(`id`) FROM `download` where `refid`='".$arr['id']."' and `type`='file' and `time`>'".$time."'"); $count2 = mysql_result($counter2,0); if ($count2 == 0) {$counts = $count;} else {$counts = ''.$count.'/+'.$count2.'';} echo '';}