Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=88206
Postga havola
TimX [613] [off]
Sardor,
cat_id - mysql bazadagi kategoriya nomini qo'yas
<?php echo '<div class="phdr">Yangiliklar</div>'; $total= mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news` WHERE `time` AND `cat_id`= 2"), 0); $kmess='4'; if($total){ $req= mysql_query("SELECT * FROM `cms_news` WHERE `cat_id`=2 ORDER BY `time` DESC LIMIT ".$start.", ".$kmess); while($trans_res= mysql_fetch_ar ray($req)){ $comm= mysql_result( mysql_query("select count(*) from `cms_news_comments` where `refid` = '".$trans_res['id']."'"),0); echo '<div class="menu"><span class="list1">'.( date('H:i ',$trans_res['time'])).'</span> – <a href="/news/index.php?act=view&id='.$trans_res['id'].'"><font color="#454545">'. htmlentities($trans_res['name'],ENT_QUOTES,'UTF-8').'</font></a> <a class="cm orang"> '.$comm.'</a></div></div>'; ++$i; } } if($total>$kmess){ echo'<div class="menu"><center>'. functions::display_pagination('?',$start,$total,$kmess).'</center></div>'; } ?>
cat_id - mysql bazadagi kategoriya nomini qo'yas