Hi,
Joomla 1.7.3 and chronoforms v4rc2
I am trying to add a select drop down that will list users in a specific group.
I am trying to acheive this but not sure where to add or how to modify this code to work in j1.7:
Any help would be greatly appreciated.
Joomla 1.7.3 and chronoforms v4rc2
I am trying to add a select drop down that will list users in a specific group.
I am trying to acheive this but not sure where to add or how to modify this code to work in j1.7:
<?php
if (!$mainframe->isSite() ) {return;}
$db =& JFactory::getDBO();
$query = "
SELECT '#__user_usergroup_map.group_id', '#__users.id', '#__users.name'
FROM '#__user_usergroup_map', '#__users'
WHERE '#__user_usergroup_map.group_id' = 10;
";
$db->setQuery($query);
$options = $db->loadAssocList();
foreach ( $options as $o ) {
echo "<option value='".$o[id]."'>".$o[name]."</option>";
}
?>
Any help would be greatly appreciated.
My bad, the code was wrong, what I did was to add the code directly and changed to
I had to remove all the colons. Just in case this is useful for someone else!
<option value="" selected>Please Select</option>
<?php
if (!$mainframe->isSite() ) {return;}
$db =& JFactory::getDBO();
$query = "
SELECT #__users.id, #__users.name
FROM #__user_usergroup_map, #__users
WHERE #__user_usergroup_map.user_id = #__users.id
AND #__user_usergroup_map.group_id = 10 ;
";
$db->setQuery($query);
$options = $db->loadAssocList();
foreach ( $options as $o ) {
echo "<option value=".$o[id].">".$o[name]."</option>" ;
}
?>
I had to remove all the colons. Just in case this is useful for someone else!
This topic is locked and no more replies can be posted.