Browse Source

Minor - reformated SQL string spacing to get better log output

Yannick Warnier 14 years ago
parent
commit
114fe66e60
1 changed files with 56 additions and 57 deletions
  1. 56 57
      main/newscorm/learnpath.class.php

+ 56 - 57
main/newscorm/learnpath.class.php

@@ -428,66 +428,65 @@ class learnpath {
 
         if ($prerequisites != 0) {
             $sql_ins = "
-                            INSERT INTO " . $tbl_lp_item . " (
-                                lp_id,
-                                item_type,
-                                ref,
-                                title,
-                                description,
-                                path,
-                                max_score,
-                                parent_item_id,
-                                previous_item_id,
-                                next_item_id,
-                                display_order,
-                                prerequisite,
-                                max_time_allowed
-
-                            ) VALUES (
-                                " . $this->get_id() . ",
-                                '" . $type . "',
-                                '',
-                                '" . $title . "',
-                                '" . $description . "',
-                                '" . $id . "',
-                                '" . $max_score . "',
-                                " . $parent . ",
-                                " . $previous . ",
-                                " . $next . ",
-                                " . ($display_order +1) . ",
-                                " . $prerequisites . ",
-                                " . $max_time_allowed . "
-                            )";
+                            INSERT INTO " . $tbl_lp_item . " ( ".
+                                "lp_id, ".
+                                "item_type, ".
+                                "ref, ".
+                                "title, ".
+                                "description, ".
+                                "path, ".
+                                "max_score, ".
+                                "parent_item_id, ".
+                                "previous_item_id, ".
+                                "next_item_id, ".
+                                "display_order, ".
+                                "prerequisite, ".
+                                "max_time_allowed ".
+                            ") VALUES ( ".
+                                $this->get_id() . ", ".
+                                "'" . $type . "', ".
+                                "'', ".
+                                "'" . $title . "', ".
+                                "'" . $description . "', ".
+                                "'" . $id . "', ".
+                                "'" . $max_score . "', ".
+                                $parent . ", ".
+                                $previous . ", ".
+                                $next . ", ".
+                                ($display_order +1) . ", ".
+                                $prerequisites . ", ".
+                                $max_time_allowed .
+                            ")";
         } else {
             // Insert new item.
             $sql_ins = "
-                            INSERT INTO " . $tbl_lp_item . " (
-                                lp_id,
-                                item_type,
-                                ref,
-                                title,
-                                description,
-                                path,
-                                max_score,
-                                parent_item_id,
-                                previous_item_id,
-                                next_item_id,
-                                display_order,
-                                max_time_allowed
-                            ) VALUES (
-                                " . $this->get_id() . ",
-                                '" . $type . "',
-                                '',
-                                '" . $title . "',
-                                '" . $description . "',
-                                '" . $id . "',
-                                '" . $max_score . "',
-                                " . $parent . ",
-                                " . $previous . ",
-                                " . $next . ",
-                                " . ($display_order +1) . ",
-                                " . $max_time_allowed . "
-                            )";
+                            INSERT INTO " . $tbl_lp_item . " ( ".
+                                "lp_id, ".
+                                "item_type, ".
+                                "ref, ".
+                                "title, ".
+                                "description, ".
+                                "path, ".
+                                "max_score, ".
+                                "parent_item_id, ".
+                                "previous_item_id, ".
+                                "next_item_id, ".
+                                "display_order, ".
+                                "max_time_allowed ".
+                            ") VALUES (".
+                                $this->get_id() . ",".
+                                "'" . $type . "',".
+                                "'',".
+                                "'" . $title . "',".
+                                "'" . $description . "',".
+                                "'" . $id . "',".
+                                "'" . $max_score . "',".
+                                $parent . ",".
+                                $previous . ",".
+                                $next . ",".
+                                ($display_order +1) . ",".
+                                $max_time_allowed .
+                            ")";
         }
 
         if ($this->debug > 2) {