<?php
$rasm_count = @ mysql_result(mysql_query("SELECT COUNT(*) FROM `downfiles` WHERE `pathid` = '3'"), 0);
echo '<div class="phdr">Rasmlar <span class="count_phdr">' .$rasm_count. '</span></div>';

$query = mysql_query("SELECT * FROM `downfiles` WHERE `pathid` = '3' AND `status` = '1' ORDER BY `time` DESC LIMIT 5"); 
$ok = mysql_fetch_array($query); 
$ok['name'] = str_replace('||||','',$ok['name']); 
$totalk = mysql_result(mysql_query("SELECT COUNT(*) FROM `downkomm` WHERE `fileid` = '" . $ok['id'] . "';"), 0);
do { 
    echo '
        <a href="/download/loadfile.php?down=' .$ok['way']. '">
            <div class="cmenu">
                <img style="width: 24px;vertical-align: middle;height: 17px;" src="/download/img/rasm.png" /> 
                ' .$ok['name']. '
                <span class="news_time">
                    (Yuklanid: ' .$ok['count']. ')
                </span>
            </div>
        </a>
    ';
} 
while($ok = mysql_fetch_array($query));
?>