From 4f39d4fb3a18d37519d9aca2b5abf4fdbc00128b Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 10 Jun 2003 16:40:36 +0000 Subject: [PATCH] Changed the log_check_backup function to execute a count_records instead of selecting everyting (crash when there is a lot of log entries). --- backup/backuplib.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/backup/backuplib.php b/backup/backuplib.php index 6697f482c4..284c5a4684 100644 --- a/backup/backuplib.php +++ b/backup/backuplib.php @@ -104,17 +104,13 @@ 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; } -- 2.39.5