Completed
Push — master ( 14f1c2...1cc6cb )
by Lars
02:38
created
src/voku/db/Helper.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
   /**
13 13
    * return all db-fields from a table
14 14
    *
15
-   * @param string $database
16 15
    * @param string $table
17 16
    * @param bool   $useStaticCache
18 17
    *
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     $dbFields = array();
36 36
     $db = DB::getInstance();
37 37
 
38
-    $sql = "SHOW COLUMNS FROM `" . $db->escape($table) . "`";
38
+    $sql = "SHOW COLUMNS FROM `".$db->escape($table)."`";
39 39
     $result = $db->query($sql);
40 40
 
41 41
     if ($result && $result->num_rows > 0) {
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
     $table = $db->escape($table);
72 72
 
73 73
     foreach ($whereArray as $key => $value) {
74
-      $whereSQL = ' AND ' . $db->escape($key) . ' = ' . $db->escape($value);
74
+      $whereSQL = ' AND '.$db->escape($key).' = '.$db->escape($value);
75 75
     }
76 76
 
77 77
     // get the row
78
-    $query = "SELECT * FROM " . $table . "
78
+    $query = "SELECT * FROM ".$table."
79 79
       WHERE 1 = 1
80
-      " . $whereSQL . "
80
+      " . $whereSQL."
81 81
     ";
82 82
     $result = $db->query($query);
83 83
 
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
             if (array_key_exists($fieldName, $updateArray)) {
98 98
 
99 99
               if ($updateArray[$fieldName] || $updateArray[$fieldName] == 0) {
100
-                $insert_keys .= ',' . $fieldName;
100
+                $insert_keys .= ','.$fieldName;
101 101
                 $insert_values .= ',?';
102 102
                 $bindings[] = $updateArray[$fieldName];
103 103
               }
104 104
 
105 105
             } else {
106
-              $insert_keys .= ',' . $fieldName;
106
+              $insert_keys .= ','.$fieldName;
107 107
               $insert_values .= ',?';
108 108
               $bindings[] = $value;
109 109
             }
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
         }
112 112
 
113 113
         // insert the "copied" row
114
-        $new_query = "INSERT INTO `" . $table . "` (" . ltrim($insert_keys, ',') . ")
115
-          VALUES (" . ltrim($insert_values, ',') . ")
114
+        $new_query = "INSERT INTO `".$table."` (".ltrim($insert_keys, ',').")
115
+          VALUES (" . ltrim($insert_values, ',').")
116 116
         ";
117 117
         $return = $db->query($new_query, $bindings);
118 118
       }
Please login to merge, or discard this patch.