First i managed to display all the category names that are in sectionid 11 in a list.
Now i want to count the number of articles in the particular category in section 11.
my article table is: mos_content
section field is: sectionid
category field: catid
I want to display it like
Category name (no.of.articles.in.category)
Category name (no.of.articles.in.category)
Category name (no.of.articles.in.category)
Category name (no.of.articles.in.category)
Category name (no.of.articles.in.category)
I managed to display the total number of articles in section 11 but not within each category. Here is my code. Im doing the count and category list seperate as im kinda new to this. so can ya help me out
Code: Select all
<?php
$count=mysql_query("SELECT COUNT(*) FROM mos_content WHERE sectionid='11'");
echo "</br>";
{
echo mysql_result($count,0);
}
echo "</br>";
$cats=mysql_query("select * from mos_categories WHERE section='11' ORDER BY `title` ASC") or die(mysql_error());
while ($donnee = mysql_fetch_array($cats))
{ $title= $donnee['title'];
echo $title;
echo "</br>";
}
?>