@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace src\pdodatabase\sentencias\insert; |
| 3 | 3 | |
| 4 | -use src\pdodatabase\elementos\{Tabla,Insert}; |
|
| 4 | +use src\pdodatabase\elementos\{Tabla, Insert}; |
|
| 5 | 5 | |
| 6 | 6 | class SentenciaInsert |
| 7 | 7 | { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | foreach ($array as $key => $value) |
| 45 | 45 | { |
| 46 | - if(empty($key)) |
|
| 46 | + if (empty($key)) |
|
| 47 | 47 | { |
| 48 | 48 | throw new Exception("Error Processing Request"); |
| 49 | 49 | } |
@@ -54,20 +54,20 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $keys = array_keys($array); |
| 56 | 56 | $values = ''; |
| 57 | - $x=1; |
|
| 57 | + $x = 1; |
|
| 58 | 58 | |
| 59 | - foreach($array as $field) |
|
| 59 | + foreach ($array as $field) |
|
| 60 | 60 | { |
| 61 | - $values.= "?"; |
|
| 61 | + $values .= "?"; |
|
| 62 | 62 | |
| 63 | - if($x < count($array)) |
|
| 63 | + if ($x < count($array)) |
|
| 64 | 64 | { |
| 65 | - $values.= ', '; |
|
| 65 | + $values .= ', '; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $x++; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - return "(`". implode('`, `', $keys) ."`) VALUES ({$values})"; |
|
| 71 | + return "(`".implode('`, `', $keys)."`) VALUES ({$values})"; |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | \ No newline at end of file |