You can obtain Joomla UserGroup id by name with the following code:
1 2 3 4 5 6 7 8 |
$db = JFactory::getDBO(); $query = $db->getQuery(true) ->select('a.id') ->from('#__usergroups AS a') ->where('a.title="'.$name.'"'); $db->setQuery($query); $gid = $db->loadResult(); |





