From: stronk7 <stronk7>
Date: Sun, 4 Jan 2004 12:48:33 +0000 (+0000)
Subject: Changed code to use the insert_record() function in
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d8e24b78ea279a01bf2bd28bb46ea167b31b6138;p=moodle.git

Changed code to use the insert_record() function in
the backup/restore backup_putid() function. To solve
bug 946 (http://moodle.org/bugs/bug.php?op=show&bugid=946).
---

diff --git a/backup/lib.php b/backup/lib.php
index 4475384b87..83425c0591 100644
--- a/backup/lib.php
+++ b/backup/lib.php
@@ -412,10 +412,14 @@
 
         //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;
     }