Parašė ramon· 2008 Rugp. 25 00:08:41
#27
<?php
opentable("Naujienu meniu");
echo"<b><br><center>naujienos mIRC</center></b>";
$id = "news_cat_id='10' || news_cat_id='12' || news_cat_id='1'";
$uzklausa_a = "SELECT * FROM ".DB_PREFIX."news_cats WHERE $id ORDER BY news_cat_id ASC";
$a = dbquery($uzklausa_a);
while ($b = dbarray($a)) {
$uzklausa_b = "SELECT news_id, COUNT(news_id) as naujienu FROM ".DB_PREFIX."news WHERE news_cat='".$b['news_cat_id']."' GROUP BY news_cat";
$c = dbquery($uzklausa_b);
while ($d = dbarray($c)) echo "<a href='".BASEDIR."news_cats.php?cat_id=".$b['news_cat_id']."'>".$b['news_cat_name']."</a> (<b>".$d['naujienu']."</b>) <Br>";
}
echo"<b><br><center>Kitos naujienos</center></b>";
$id2 = "news_cat_id='4' || news_cat_id='9' || news_cat_id='2'";
$uzklausa_c = "SELECT * FROM ".DB_PREFIX."news_cats WHERE $id2 ORDER BY news_cat_id ASC";
$e = dbquery($uzklausa_c);
while ($f = dbarray($e)) {
$uzklausa_d = "SELECT news_id, COUNT(news_id) as naujienu FROM ".DB_PREFIX."news WHERE news_cat='".$f['news_cat_id']."' GROUP BY news_cat";
$g = dbquery($uzklausa_d);
while ($h = dbarray($g)) echo "<a href='".BASEDIR."news_cats.php?cat_id=".$f['news_cat_id']."'>".$f['news_cat_name']."</a> (<b>".$h['naujienu']."</b>) <Br>";
}
closetable();
?>