質問編集履歴

4

内容修正

2017/06/19 15:52

投稿

rainbowsix
rainbowsix

スコア102

test CHANGED
File without changes
test CHANGED
@@ -40,9 +40,15 @@
40
40
 
41
41
  <input type= 'checkbox' name='1' value='1' checked >
42
42
 
43
+ <input type= 'checkbox' name='1' value='2'>
44
+
43
45
  <input type= 'checkbox' name='3' value='3' checked >
44
46
 
47
+ <input type= 'checkbox' name='1' value='4'>
48
+
45
49
  <input type= 'checkbox' name='5' value='5' checked >
50
+
51
+ <input type= 'checkbox' name='1' value='6'>
46
52
 
47
53
 
48
54
 

3

内容修正。

2017/06/19 15:52

投稿

rainbowsix
rainbowsix

スコア102

test CHANGED
File without changes
test CHANGED
@@ -4,17 +4,15 @@
4
4
 
5
5
  while($row = $resList->fetchRow()){
6
6
 
7
- if (array_search($row[0], (array)$hoge) !== FALSE)
7
+ if (array_search($row[0], (array)$array) !== FALSE)
8
8
 
9
- {
9
+ {
10
10
 
11
- echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' checked >";
11
+ echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' checked >";
12
12
 
13
+ }
13
14
 
14
-
15
- }
16
-
17
- else {echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' >";}
15
+ else {echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' >";}
18
16
 
19
17
  }
20
18
 
@@ -24,7 +22,11 @@
24
22
 
25
23
 
26
24
 
25
+ $row=array("1", "2", "3","4", "5", "6");
26
+
27
- $row[0]は0から10まループします。
27
+ です。
28
+
29
+
28
30
 
29
31
  $arrayの1、3、5と$row[0]が一致する場合のみ
30
32
 
@@ -44,6 +46,8 @@
44
46
 
45
47
 
46
48
 
47
- どうしたらでしょうか?
49
+ 上記のコードで問題ないでしょうか?
50
+
51
+
48
52
 
49
53
  よろしくお願いいたします。

2

修正

2017/06/19 15:34

投稿

rainbowsix
rainbowsix

スコア102

test CHANGED
File without changes
test CHANGED
@@ -8,13 +8,13 @@
8
8
 
9
9
  {
10
10
 
11
- echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' checked >$row[1]";
11
+ echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' checked >";
12
12
 
13
13
 
14
14
 
15
15
  }
16
16
 
17
- else {echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' >$row[1]";}
17
+ else {echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' >";}
18
18
 
19
19
  }
20
20
 

1

内容修正

2017/06/19 15:22

投稿

rainbowsix
rainbowsix

スコア102

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  $array = array("1", "3", "5");
4
4
 
5
-
5
+ while($row = $resList->fetchRow()){
6
6
 
7
7
  if (array_search($row[0], (array)$hoge) !== FALSE)
8
8
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  else {echo "<input type= 'checkbox' name='[$row[0]]' value='$row[0]' >$row[1]";}
18
18
 
19
-
19
+ }
20
20
 
21
21
  ```
22
22