From 7b18f18a1ecc92957cccb92f9bb08f193009cf9b Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Fri, 28 Sep 2012 14:02:52 +0200 Subject: [PATCH] MDL-30514 registration: table aliases don't use AS keyword This is a backport of both MDL-34072, MDL-34440 (initial fix and following regression). Basically it's about to observe #12 of: http://docs.moodle.org/dev/Database (Use the AS keyword always with column aliases but not with table aliases) --- course/lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/course/lib.php b/course/lib.php index 910850f09de..bc4d0722bea 100644 --- a/course/lib.php +++ b/course/lib.php @@ -3945,7 +3945,7 @@ function average_number_of_participants() { WHERE ue.enrolid = e.id AND e.courseid <> :siteid AND c.id = e.courseid - AND c.visible = 1) as total'; + AND c.visible = 1) total'; $params = array('siteid' => $SITE->id); $enrolmenttotal = $DB->count_records_sql($sql, $params); @@ -3978,7 +3978,7 @@ function average_number_of_courses_modules() { WHERE c.id = cm.course AND c.id <> :siteid AND cm.visible = 1 - AND c.visible = 1) as total'; + AND c.visible = 1) total'; $params = array('siteid' => $SITE->id); $moduletotal = $DB->count_records_sql($sql, $params);