From: stronk7 Date: Mon, 29 Jan 2007 00:17:25 +0000 (+0000) Subject: First real test of the new rs_fetchXXX() functions. Applying it X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b5eb752394f63abfd451f68b1653316d456b33c6;p=moodle.git First real test of the new rs_fetchXXX() functions. Applying it to get_my_courses(). MDL-8134 Merged from MOODLE_17_STABLE --- diff --git a/lib/datalib.php b/lib/datalib.php index 4f27c91984..bd39d65d9e 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -747,9 +747,7 @@ ORDER BY $sort"); } if ($rs && $rs->RecordCount() > 0) { - while (!$rs->EOF) { - $course = (object)$rs->fields; - + while ($course = rs_fetch_next_record($rs)) { if ($course->id != SITEID) { // users with moodle/course:view are considered course participants // the course needs to be visible, or user must have moodle/course:viewhiddencourses @@ -769,8 +767,6 @@ ORDER BY $sort"); } } } - - $rs->MoveNext(); } }