回答編集履歴
2
参考
test
CHANGED
@@ -15,3 +15,69 @@
|
|
15
15
|
}
|
16
16
|
|
17
17
|
```
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
# 参考
|
22
|
+
|
23
|
+
print_rの結果が
|
24
|
+
|
25
|
+
Array ( [number] => 10 [rare] => C [name] => リリス )
|
26
|
+
|
27
|
+
で、「C」と「リリス」をえたいなら、こんな感じでしょうか?
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
```PHP
|
32
|
+
|
33
|
+
print "<ul>".PHP_EOL;
|
34
|
+
|
35
|
+
while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
|
36
|
+
|
37
|
+
print "<li>";
|
38
|
+
|
39
|
+
print htmlspecialchars($row["rare"]).":";
|
40
|
+
|
41
|
+
print htmlspecialchars($row["name"]);
|
42
|
+
|
43
|
+
print "</li>".PHP_EOL;
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
print "</ul>".PHP_EOL;
|
48
|
+
|
49
|
+
```
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
テーブルならこんな感じでしょうか
|
54
|
+
|
55
|
+
```PHP
|
56
|
+
|
57
|
+
print "<table>".PHP_EOL;
|
58
|
+
|
59
|
+
print "<thead>".PHP_EOL;
|
60
|
+
|
61
|
+
print "<tr><th>レア</th><th>名前</th>".PHP_EOL;
|
62
|
+
|
63
|
+
print "</thead>".PHP_EOL;
|
64
|
+
|
65
|
+
print "<tbody>".PHP_EOL;
|
66
|
+
|
67
|
+
while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
|
68
|
+
|
69
|
+
print "<tr>";
|
70
|
+
|
71
|
+
print "<td>".htmlspecialchars($row["rare"])."</td>";
|
72
|
+
|
73
|
+
print "<td>".htmlspecialchars($row["name"])."</td>";
|
74
|
+
|
75
|
+
print "</tr>".PHP_EOL;
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
print "</tbody>".PHP_EOL;
|
80
|
+
|
81
|
+
print "</table>".PHP_EOL;
|
82
|
+
|
83
|
+
```
|
1
typo
test
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
|
9
9
|
```PHP
|
10
10
|
|
11
|
-
while($row
|
11
|
+
while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
|
12
12
|
|
13
|
-
print_r($row
|
13
|
+
print_r($row);
|
14
14
|
|
15
15
|
}
|
16
16
|
|