質問編集履歴
1
※コメントいただいた点を更新しました。xxx部は製品名となります。製品名を配列でSQLに格納し、更新するために読み出した際にまたチェックボックスで表示(さらに更新)出来るようにしたいです
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,6 +16,8 @@
|
|
16
16
|
|
17
17
|
ご指導いただければと思います。
|
18
18
|
|
19
|
+
|
20
|
+
|
19
21
|
```PHP
|
20
22
|
|
21
23
|
//MySQLデータベースに接続する
|
@@ -26,7 +28,7 @@
|
|
26
28
|
|
27
29
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
28
30
|
|
29
|
-
$sql = "SELECT * FROM
|
31
|
+
$sql = "SELECT * FROM データベース名 WHERE id LIKE(:id)";
|
30
32
|
|
31
33
|
$stm = $pdo->prepare($sql);
|
32
34
|
|
@@ -46,7 +48,7 @@
|
|
46
48
|
|
47
49
|
// 「product」かどうか確認する
|
48
50
|
|
49
|
-
$product = ['
|
51
|
+
$product = ['製品A','製品B','製品C','製品D','製品E'];
|
50
52
|
|
51
53
|
$diffValue = array_diff($row["productarry"], $product);
|
52
54
|
|
@@ -72,15 +74,15 @@
|
|
72
74
|
|
73
75
|
echo "<div class='form-group'>", "<div class='col-lg-8'>", "<div class='checkbox' id='product'>", "<h4>", "Product Type", "</h4>",
|
74
76
|
|
75
|
-
"<label>", "<input type='checkbox' name='productarry[]' value='
|
77
|
+
"<label>", "<input type='checkbox' name='productarry[]' value='製品A' $productarry", "製品A", "</label>", "<span style='margin-right: 25px;'>", "</span>",
|
76
78
|
|
77
|
-
"<label>", "<input type='checkbox' name='productarry[]' value='
|
79
|
+
"<label>", "<input type='checkbox' name='productarry[]' value='製品B' > $productarry", "製品B", "</label>", "<span style='margin-right: 25px;'>", "</span>",
|
78
80
|
|
79
|
-
"<label>", "<input type='checkbox' name='productarry[]' value='
|
81
|
+
"<label>", "<input type='checkbox' name='productarry[]' value='製品C' > $productarry ", "製品C", "</label>", "<span style='margin-right: 25px;'>", "</span>",
|
80
82
|
|
81
|
-
"<label>", "<input type='checkbox' name='productarry[]' value='
|
83
|
+
"<label>", "<input type='checkbox' name='productarry[]' value='製品D' > $productarry", "製品D", "</label>", "<span style='margin-right: 25px;'>", "</span>",
|
82
84
|
|
83
|
-
"<label>", "<input type='checkbox' name='productarry[]' value='
|
85
|
+
"<label>", "<input type='checkbox' name='productarry[]' value='製品E' > $productarry", "製品E", "</label>", "<span style='margin-right: 25px;'>", "</span>",
|
84
86
|
|
85
87
|
"<br>",
|
86
88
|
|