use php to get parent categry id - Joomla! Forum - community, help and support
hi
back in day of 1.5 used able id of sections , categories using this:
now want @ id of parent category.
how please?
thanks
back in day of 1.5 used able id of sections , categories using this:
code: select all
$db =& jfactory::getdbo();
$thisarticle=jrequest::getint( 'id');
$query = 'select sectionid, catid #__content id = ' . $thisarticle;
$db->setquery($query);
$rows = $db->loadobjectlist();
// dummy values in case no section or category
$sectionid=-1; $categoryid=-1;
foreach ( $rows $row ) {
$categoryid=$row->catid;
$sectionid=$row->sectionid;
echo '<p>secid='.$sectionid.' catid='.$categoryid.'</p>';
}
now want @ id of parent category.
how please?
thanks
interesting question... had problem myself. solved querying categories table, has parent category ids.but know if there joomla function accomplish task...
i don't have code here right now, can post later if want.
i don't have code here right now, can post later if want.
Comments
Post a Comment