Parašė ramon· 2008 Rugp. 24 22:08:45
#19
Imk, uzklausa yra lb simple...
Kodas:
<?
opentable("");
$uzklausa_a = "SELECT * FROM ".DB_PREFIX."news_cats 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 "<b>Kategorija:</b> ".$b['news_cat_name']." (<b>Naujienu:</b> ".$d['naujienu'].") <b>ID:</b> ".$b['news_cat_id']."<Br>";
}
closetable();
?>