質問編集履歴
2
コード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,6 +12,34 @@
|
|
12
12
|
|
13
13
|
回答よろしくお願いします
|
14
14
|
|
15
|
+
Crud.phpの下の部分です
|
16
|
+
|
17
|
+
public static function update($id, array $data)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
{
|
22
|
+
|
23
|
+
$mysqli = self::connect();
|
24
|
+
|
25
|
+
foreach ($data as $key => $value);
|
26
|
+
|
27
|
+
{
|
28
|
+
|
29
|
+
var_dump($key, $value);
|
30
|
+
|
31
|
+
$sql2 = "UPDATE `crud_test` SET `{$key}` = '{$value}' WHERE `id` = {$id}";
|
32
|
+
|
33
|
+
var_dump($sql2);
|
34
|
+
|
35
|
+
$result = $mysqli->query($sql2);
|
36
|
+
|
37
|
+
return $result;
|
38
|
+
|
39
|
+
}
|
40
|
+
|
41
|
+
}
|
42
|
+
|
15
43
|
edit_post.php
|
16
44
|
|
17
45
|
```php
|
1
誤字
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
```
|
70
70
|
|
71
|
-
```h
|
71
|
+
```php
|
72
72
|
|
73
73
|
<?php
|
74
74
|
|
@@ -210,7 +210,7 @@
|
|
210
210
|
|
211
211
|
```
|
212
212
|
|
213
|
-
```h
|
213
|
+
```php
|
214
214
|
|
215
215
|
<?php
|
216
216
|
|