Permalink
Browse files

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)
  • Loading branch information...
1 parent c5575c6 commit 7b18f18a1ecc92957cccb92f9bb08f193009cf9b @stronk7 stronk7 committed Sep 28, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 course/lib.php
View
@@ -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);

0 comments on commit 7b18f18

Please sign in to comment.