Permalink
Browse files

Merge branch 'MDL-25713_recordset' of git://github.com/andyjdavis/moo…

…dle into MOODLE_19_STABLE
  • Loading branch information...
skodak committed Dec 27, 2010
2 parents 535037f + 49436db commit 76035b13394c2ce58fd24f7aae0a0e848311cb42
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/grade/grade_object.php
@@ -173,13 +173,14 @@ function fetch_all_helper($table, $classname, $params) {
$wheresql = implode("AND", $wheresql);
}
- if ($datas = get_records_select($table, $wheresql, 'id')) {
+ if ($rs = get_recordset_select($table, $wheresql, 'id')) {
$result = array();
- foreach($datas as $data) {
+ while ($data = rs_fetch_next_record($rs)) {
$instance = new $classname();
grade_object::set_properties($instance, $data);
$result[$instance->id] = $instance;
}
+ rs_close($rs);
return $result;
} else {

0 comments on commit 76035b1

Please sign in to comment.