PDA

View Full Version : Query needed to select global mods/admins


Darth Cow
07-27-2002, 02:31 AM
I'm modifying report.php so I can report PMs as well :). How would I change this to select all super moderators/admins instead? (usergroups 5 and 6)

$moderators=$DB_site->query("SELECT DISTINCT user.userid FROM moderator,user WHERE user.userid=moderator.userid AND moderator.forumid IN ($foruminfo[parentlist])");

Thanks! My SQL skills are kinda lacking... :)

Xenon
07-27-2002, 10:43 AM
hmm, not sure, but try this:
$moderators=$DB_site->query("SELECT DISTINCT user.userid FROM usergoup,user WHERE user.usergroupid=usergroup.usergroupid AND (usergroup.ismoderator=1 OR usergroup.cancontrolpanel=1)");