plugins/content/categories/categories.php
private function _countItemsInCategory($table, $catid)
	{
		$db = JFactory::getDbo();
		$query = $db->getQuery(true);

		// Count the items in this category
		$query->select('COUNT(id)')
			->from($table)
			->where('catid = ' . $catid);
		$db->setQuery($query);

		try
		{
			$count = $db->loadResult();
		}
		catch (RuntimeException $e)
		{
			JError::raiseWarning(500, $e->getMessage());

			return false;
		}

		return $count;
	}
private function _countItemsInCategory($table, $catid)
	{
		$db = JFactory::getDbo();
		$query = $db->getQuery(true);

		// Count the items in this category
		$query->select('COUNT(id)')
			->from($table)
			->where('catid = ' . $catid);
		$db->setQuery($query);

		try
		{
			$count = $db->loadResult();
		}
		catch (RuntimeException $e)
		{
			JError::raiseWarning(500, $e->getMessage());

			return false;
		}

		return $count;
	}
private function _countItemsInCategory ( $ table , $ catid ) { $ db = JFactory :: getDbo ( ) ; $ query = $ db -> getQuery ( true ) ; // Count the items in this category $ query -> select ( 'COUNT(id)' ) -> from ( $ table ) -> where ( 'catid = ' . $ catid ) ; $ db -> setQuery ( $ query ) ; try { $ count = $ db -> loadResult ( ) ; } catch ( RuntimeException $ e ) { JError :: raiseWarning ( 500 , $ e -> getMessage ( ) ) ; return false ; } return $ count ; }
Get count of items in a category

@param   string   $table  table name of component table (column is catid)
@param   integer  $catid  id of the category to check

@return  mixed  count of items found or false if db error

@since   1.6
Get count of items in a category