diff --git a/index.php b/index.php index 409d88c..679e34b 100644 --- a/index.php +++ b/index.php @@ -160,8 +160,8 @@ if ($sort == 'timecreated') { $sql .= " ORDER BY u.{$sort}"; } -$userlist = $DB->get_records_sql($sql, $params + $where_params); -$total = count($userlist); +$total = $DB->count_records_sql($sql, $params + $where_params); +$userlist = $DB->get_records_sql($sql, $params + $where_params, $start); if ($csv && $userlist) { // Only show CSV if there are some users $shortname = format_string($course->shortname, true, array('context' => $context));