]> git.mjollnir.org Git - moodle.git/commitdiff
First real test of the new rs_fetchXXX() functions. Applying it
authorstronk7 <stronk7>
Mon, 29 Jan 2007 00:17:25 +0000 (00:17 +0000)
committerstronk7 <stronk7>
Mon, 29 Jan 2007 00:17:25 +0000 (00:17 +0000)
to get_my_courses(). MDL-8134

Merged from MOODLE_17_STABLE

lib/datalib.php

index 4f27c91984b8880083b46115c6b251791a0812a7..bd39d65d9e2f9dc64cfe24dd34d9fb37dae8939a 100644 (file)
@@ -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();
         }
     }