selectObjectCount( tablename $tablename, [where $where = ''], [column $column = '1'], [distinct $distinct = false], [categoryFilter $categoryFilter = null])
where the categoryfilter is a list of categories to use, i need to count the number in only 1 category, it works if i leave out the category filter to get the total number of objects, i just have no idea how to specify a category....
Code
$categories = categoryUtil::getCategoriesByPath($cat['path'], '', 'path');
$catempty = array();
foreach ($categories as $category) {
$catempty[$category['id']] = DBUtil::selectObjectCount('faqanswer', '', 'faqid', false, array('category' => $category['id']);
}
$pnRender->assign('isempty', $catempty);
$catempty = array();
foreach ($categories as $category) {
$catempty[$category['id']] = DBUtil::selectObjectCount('faqanswer', '', 'faqid', false, array('category' => $category['id']);
}
$pnRender->assign('isempty', $catempty);
is what i'm trying to do... but it returns 0 for every category
any suggestions.
edited by: kylegio, Jan 16, 2009 - 09:27 AM
