<?php
require_once 'news/db.php';
require_once 'news/config.php';
$catname = 'Testcat'; #name of the category you want to count the articles for
$articlecount = DataAccess::fetch("SELECT COUNT(uid) AS totalarticles FROM $newsgroupcats INNER JOIN $newscats ON $newsgroupcats.catid = $newscats.id WHERE $newscats.name = ?", $catname);
$articlecount = $articlecount['0']['totalarticles'];
echo $articlecount;
?>
<?php
require_once 'news/db.php';
require_once 'news/config.php';
$catname = 'Testcat'; #name of the category you want to count the articles for
$articlecount = DataAccess::fetch("SELECT COUNT(uid) AS totalarticles FROM " . NEWS_GROUPCATS . " INNER JOIN " . NEWS_CATS . " ON " . NEWS_GROUPCATS . ".catid = " . NEWS_CATS . ".id WHERE " . NEWS_CATS . ".name = ? AND " . NEWS_GROUPCATS . ".type = ?", $catname, "news");
$articlecount = $articlecount['0']['totalarticles'];
echo $articlecount;
?>