$bolim= ''.$id.'';
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news` WHERE `refid`= '$bolim'"), 0);
echo '<div class="phdr"> Mavzuga oid yangiliklar </div>';
echo '<div class="menu">';
if ($total) {
$req = mysql_query("SELECT * FROM `cms_news` WHERE `refid`= '$bolim' ORDER BY `time` DESC LIMIT 3");
$i = 1;
while (($tayota = mysql_fetch_assoc($req)) !== false) {
$comm = mysql_result(mysql_query("select count(*) from `cms_news_comments` where `refid` = '".$tayota['id']."'"), 0);
echo '<a href="'.$home.'/news/index.php?act=view&amp;id='.$tayota['id'].'"><img src="/ico/link.png" alt="link"/> '.$tayota['name'].'</a><hr>';
++$i;
}
}
echo '</div>';