"MDL-24851, added DISTINCT statements"

This commit is contained in:
Dongsheng Cai 2010-10-27 13:16:52 +00:00
parent fe983847dd
commit fc98c3aecb

View File

@ -5957,7 +5957,7 @@ function forum_remove_user_tracking($userid, $context) {
if (!is_enrolled($context, $userid)) {
if ($course = $DB->get_record('course', array('id' => $context->instanceid), 'id')) {
// find all forums in which this user has reading tracked
if ($forums = $DB->get_records_sql("SELECT f.id, cm.id as coursemodule
if ($forums = $DB->get_records_sql("SELECT DISTINCT f.id, cm.id as coursemodule
FROM {forum} f,
{modules} m,
{course_modules} cm,