]> git.mjollnir.org Git - moodle.git/commitdiff
Changed the log_check_backup function to execute a count_records
authorstronk7 <stronk7>
Tue, 10 Jun 2003 16:40:36 +0000 (16:40 +0000)
committerstronk7 <stronk7>
Tue, 10 Jun 2003 16:40:36 +0000 (16:40 +0000)
instead of selecting everyting (crash when there is a lot of log entries).

backup/backuplib.php

index 6697f482c45ed80387c4338cc1098d25ed22c81e..284c5a4684fc638ca64426efdbee82d3030b5b49 100644 (file)
 
         global $CFG;
 
-        //Execute the insert
-        $status = execute_sql($sql_insert,false);
+        //Now execute the count
+        $ids = count_records("log","course",$course);
 
-        //Now execute the select
-        $ids = get_records_sql("SELECT DISTINCT l.id,l.course
-                                FROM {$CFG->prefix}log l
-                                WHERE l.course = '$course'");
         //Gets the user data
         $info[0][0] = get_string("logs");
         if ($ids) {
-            $info[0][1] = count($ids);
+            $info[0][1] = $ids;
         } else {
             $info[0][1] = 0;
         }