Created
March 9, 2009 19:02
-
-
Save danopia/76420 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod | |
FROM " . GROUPS_TABLE . " g, " . AUTH_ACCESS_TABLE . " aa | |
WHERE g.group_id = $group_id | |
AND aa.group_id = g.group_id | |
UNION ( | |
SELECT g.group_moderator, g.group_type, NULL | |
FROM " . GROUPS_TABLE . " g | |
WHERE g.group_id = $group_id | |
AND NOT EXISTS ( | |
SELECT aa.group_id | |
FROM " . AUTH_ACCESS_TABLE . " aa | |
WHERE aa.group_id = g.group_id | |
) | |
)"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment