From: toyomoyo Date: Thu, 2 Nov 2006 02:17:39 +0000 (+0000) Subject: merged fix for MDL-7112 select distinct on text field X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=51693108474c6ca95aec7e3c7212216ec88055ae;p=moodle.git merged fix for MDL-7112 select distinct on text field --- diff --git a/mod/lesson/essay.php b/mod/lesson/essay.php index 56b764f8fc..3a5235d246 100644 --- a/mod/lesson/essay.php +++ b/mod/lesson/essay.php @@ -30,7 +30,7 @@ // Get only the attempts that are in response to essay questions if ($essayattempts = get_records_select('lesson_attempts', 'pageid IN('.implode(',', array_keys($pages)).')')) { // Get all the users who have taken this lesson, order by their last name - if (!$users = get_records_sql("SELECT DISTINCT u.* + if (!$users = get_records_sql("SELECT u.* FROM {$CFG->prefix}user u, {$CFG->prefix}lesson_attempts a WHERE a.lessonid = '$lesson->id' and @@ -130,7 +130,7 @@ } } else { $queryadd = ''; - if (!$users = get_records_sql("SELECT DISTINCT u.* + if (!$users = get_records_sql("SELECT u.* FROM {$CFG->prefix}user u, {$CFG->prefix}lesson_attempts a WHERE a.lessonid = '$lesson->id' and diff --git a/mod/lesson/report.php b/mod/lesson/report.php index a4fa18f7d6..6d4d32a987 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -17,7 +17,7 @@ list($cm, $course, $lesson) = lesson_get_basics($id); - if (! $students = get_records_sql("SELECT DISTINCT u.* + if (! $students = get_records_sql("SELECT u.* FROM {$CFG->prefix}user u, {$CFG->prefix}lesson_attempts a WHERE a.lessonid = '$lesson->id' and