The following code prints out categories on my website. how can I make it so that it shows how many projects are there in each category. for example Article writing(2) meaning there are currently 2 projects under the category Article writing.
[php]
-
<?php
if(isset($categories) and $categories->num_rows()>0)
{
$i=0;
foreach($categories->result() as $category)
{
if($category->is_active==1)
{
//$name = replaceSpaceWithUnderscore($category->category_name);
$name =$category->category_name;
?>
<li><a href="<?php echo site_url('project/category/'.$name); ?>"><?php echo $category->category_name;?></a></li>
<?php $i++;
}
}
} ?>
[/php]here is my website = bejees.net for reference.