]> git.mjollnir.org Git - moodle.git/commitdiff
Changed code to use the insert_record() function in
authorstronk7 <stronk7>
Sun, 4 Jan 2004 12:48:33 +0000 (12:48 +0000)
committerstronk7 <stronk7>
Sun, 4 Jan 2004 12:48:33 +0000 (12:48 +0000)
the backup/restore backup_putid() function. To solve
bug 946 (http://moodle.org/bugs/bug.php?op=show&bugid=946).

backup/lib.php

index 4475384b8732f618174cd07c1e485e0ec649fb30..83425c0591ed8cdf7e4d74cc3d3a2a5a572e4ac4 100644 (file)
 
         //Now, insert the record
         if ($status) {
-            $status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
-                                       (backup_code, table_name, old_id, new_id, info)
-                                   VALUES 
-                                       ($backup_unique_code, '$table', '$old_id', '$new_id', '$info_to_save')",false);
+            //Build the record
+            $rec->backup_code = $backup_unique_code;
+            $rec->table_name = $table;
+            $rec->old_id = $old_id;
+            $rec->new_id =$new_id;
+            $rec->info = $info_to_save;
+            
+            $status = insert_record ("backup_ids", $rec);
         }
         return $status;
     }