@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | return array(); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $sql = 'SHOW COLUMNS FROM ' . $db->escape($table); |
|
| 147 | + $sql = 'SHOW COLUMNS FROM '.$db->escape($table); |
|
| 148 | 148 | $result = $db->query($sql); |
| 149 | 149 | |
| 150 | 150 | if ($result && $result->num_rows > 0) { |
@@ -189,13 +189,13 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $whereSQL = ''; |
| 191 | 191 | foreach ($whereArray as $key => $value) { |
| 192 | - $whereSQL .= ' AND ' . $db->escape($key) . ' = ' . $db->escape($value); |
|
| 192 | + $whereSQL .= ' AND '.$db->escape($key).' = '.$db->escape($value); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | // get the row |
| 196 | - $query = 'SELECT * FROM ' . $db->quote_string($table) . ' |
|
| 196 | + $query = 'SELECT * FROM '.$db->quote_string($table).' |
|
| 197 | 197 | WHERE 1 = 1 |
| 198 | - ' . $whereSQL . ' |
|
| 198 | + ' . $whereSQL.' |
|
| 199 | 199 | '; |
| 200 | 200 | $result = $db->query($query); |
| 201 | 201 | |
@@ -214,11 +214,11 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | if (!in_array($fieldName, $ignoreArray, true)) { |
| 216 | 216 | if (array_key_exists($fieldName, $updateArray)) { |
| 217 | - $insert_keys .= ',' . $fieldName; |
|
| 217 | + $insert_keys .= ','.$fieldName; |
|
| 218 | 218 | $insert_values .= ',?'; |
| 219 | 219 | $bindings[] = $updateArray[$fieldName]; // INFO: do not escape non selected data |
| 220 | 220 | } else { |
| 221 | - $insert_keys .= ',' . $fieldName; |
|
| 221 | + $insert_keys .= ','.$fieldName; |
|
| 222 | 222 | $insert_values .= ',?'; |
| 223 | 223 | $bindings[] = $value; // INFO: do not escape non selected data |
| 224 | 224 | } |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | $insert_values = ltrim($insert_values, ','); |
| 230 | 230 | |
| 231 | 231 | // insert the "copied" row |
| 232 | - $new_query = 'INSERT INTO ' . $db->quote_string($table) . ' (' . $insert_keys . ') |
|
| 233 | - VALUES (' . $insert_values . ') |
|
| 232 | + $new_query = 'INSERT INTO '.$db->quote_string($table).' ('.$insert_keys.') |
|
| 233 | + VALUES (' . $insert_values.') |
|
| 234 | 234 | '; |
| 235 | 235 | return $db->query($new_query, $bindings); |
| 236 | 236 | } |