Permalink
Browse files

MDL-27696 datalib Fixed up misused params in get_logs_usercourse

  • Loading branch information...
1 parent a938306 commit 9741999e7708bb16d3a68c7ed0ff6e6df4d777ed Sam Hemelryk committed Jul 5, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/datalib.php
View
@@ -1844,13 +1844,15 @@ function get_logs_usercourse($userid, $courseid, $coursestart) {
$params['courseid'] = $courseid;
}
$params['userid'] = $userid;
- $params['coursestart'] = $coursestart;
+ $params['coursestart1'] = $coursestart;
+ $params['coursestart2'] = $coursestart;
+ $params['coursestart3'] = $coursestart;
- return $DB->get_records_sql("SELECT FLOOR((time - :coursestart)/". DAYSECS .") AS day, COUNT(*) AS num
+ return $DB->get_records_sql("SELECT FLOOR((time - :coursestart1)/". DAYSECS .") AS day, COUNT(*) AS num
FROM {log}
WHERE userid = :userid
- AND time > :coursestart $courseselect
- GROUP BY FLOOR((time - :coursestart)/". DAYSECS .")", $params);
+ AND time > :coursestart2 $courseselect
+ GROUP BY FLOOR((time - :coursestart3)/". DAYSECS .")", $params);
}
/**

0 comments on commit 9741999

Please sign in to comment.