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?
Quote:
Originally Posted by Sarcoth
Good stuff Banana, thank you. I got it working!  I am using a custom question which selects a user from usergroup 2; reference name = shuser.
PHP Code:
$answer .= '<select name="'.$formbit[id].'">'; $members = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "user WHERE usergroupid = 2 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>';
[/PHP]
|