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)
This commit is contained in:
Eloy Lafuente (stronk7)
2012-09-28 14:02:52 +02:00
parent c5575c63b8
commit 7b18f18a1e
+2 -2
View File
@@ -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);