1
Mazar
How to get category name using id from other table
  • 2009/10/14 8:29

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


I have been trying lot of method i used to use php foriegn function to get the name from other table using id as key. but not understanding in XOOPS tried lot but failed to get

I have this ids as array
$topic_arr[$i]->getVar("topic_cid")

trying something lke this
$categoriesHandler =& xoops_getModuleHandler('topic_categories', 'topics');
$cid = $topic_arr[$i]->getVar("topic_cid");
foreach(
$cid as $key)
{
 
$objs = $categoriesHandler->getObjects($key);
}
foreach(
$objs as $obj){
if(
$topic_arr[$i]->getVar("topic_cid")== $obj->getVar('categories_id')){
print 
$obj->getVar('category_name');
}