Log in

View Full Version : simple modification question


MogKnight
09-01-2006, 12:21 AM
I know a bit of mysql but not a ton. I'm trying to change this:


$todaysregs = $db->query("SELECT userid, joindate, options, username, opentag, closetag, posts
FROM " . TABLE_PREFIX . " user as user
LEFT JOIN " . TABLE_PREFIX . "usergroup as usergroup ON(user.usergroupid = usergroup.usergroupid)
WHERE joindate > " .$cutoff. " ORDER BY username" );


to make it so it only selects users with posts > 0.

what throws me off is the part in bold:

SELECT userid, joindate, options, username, opentag, closetag, posts
FROM " . TABLE_PREFIX . " user as user

what is the "user as user" bit? where does it fit into mysql syntax? where would I add "WHERE posts > 0"? I've tried adding it both before and after "user as user" but neither works.