Limit results by range
Posted: Tue Mar 18, 2014 1:35 pm
Ok, I'm a PHP newbie and I have a snippet of code that works to limit results to a set category, I need to change that so it limits the results to a range of categories:
Right now it only returns items in Cat number 2, I need it to return items from 2,3,4,5,6,7 - nothing I'm trying is working...
$currentItem = K2Table::getInstance('K2Item', 'Table');
$currentItem->load($itemID);
$itemCat = $currentItem->get('catid');
$includeCat = 2;
if($includeCat)
$query .= " AND c.id = {$includeCat} ";
thanks!
Right now it only returns items in Cat number 2, I need it to return items from 2,3,4,5,6,7 - nothing I'm trying is working...
$currentItem = K2Table::getInstance('K2Item', 'Table');
$currentItem->load($itemID);
$itemCat = $currentItem->get('catid');
$includeCat = 2;
if($includeCat)
$query .= " AND c.id = {$includeCat} ";
thanks!