2011-11-10, 05:45 AM
I'm trying to pick a random member from the group with the id of 8, and I can't get the proper code. I keep getting Resource id #XXX returned. This is running inside of a plugin that I'm using.
Here's what I've come up with
Anyone have an idea what I'm doing wrong?
Here's what I've come up with
//pick a random user from the group
$usergroupIn = '8';
$minPosts = '0';
$uid = $db->query("SELECT uid FROM ".TABLE_PREFIX."users WHERE usergroup = '$usergroupIn' AND postnum >=$minPosts ORDER BY rand() LIMIT 1");
$username = $db->query("SELECT username FROM ".TABLE_PREFIX."users WHERE uid = '$uid' LIMIT 1");
Anyone have an idea what I'm doing wrong?