Skip to content

Commit

Permalink
Slight fix for MySQL 4
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Dec 30, 2003
1 parent f74959f commit 2d439c9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/datalib.php
Expand Up @@ -1436,12 +1436,15 @@ function get_groups($courseid, $userid=0) {
global $CFG;

if ($userid) {
$dbselect = ", {$CFG->prefix}groups_members m";
$userselect = "AND m.groupid = g.id AND m.userid = '$userid'";
} else {
$dbselect = '';
$userselect = '';
}

return get_records_sql("SELECT DISTINCT g.*
FROM {$CFG->prefix}groups g,
{$CFG->prefix}groups_members m
FROM {$CFG->prefix}groups g $dbselect
WHERE g.courseid = '$courseid' $userselect ");
}

Expand Down

0 comments on commit 2d439c9

Please sign in to comment.