Quote:
Originally Posted by helwoe
I need some help on this code for a custom question.
I'm using this code to ask new applicants to our clan to pick from a list who they were referred by. However when I change it to the correct usergroupid = 18
It will not display any names. However usergroupid = 2 does work.
Any ideas?
|
I use the following code to successfully do what you're wanting:
The usergroup ID number I've used is 50. Try changing 50 to 18 and pray.
PHP Code:
$answer .= '<select name="'.$formbit[id].'">';
$answer .= '<option></option>';
$thisanswer = $q_{$formbit[id]};
$members = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "user
WHERE membergroupids LIKE \"%50%\"
ORDER BY username ASC");
while($row = $db->fetch_array($members)) {
$answer .= '<option value="'.$row[username].'"';
if ($row[username] == $thisanswer) {
$answer .= 'selected="selected"';
}
$answer .= '>'.$row[username].'</option>';
}
$answer .= '</select>';