質問編集履歴
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,22 +1,56 @@
|
|
1
1
|
```ここに言語を入力
|
2
|
+
|
3
|
+
$sql = "SELECT * FROM dog";
|
4
|
+
|
5
|
+
$stmt = $pdo->prepare($sql);
|
6
|
+
|
7
|
+
$stmt ->execute();
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
<table border="1" bordercolor="#0000FF">
|
12
|
+
|
13
|
+
<tr><th width="200">コード</th><th width="200">写真</th><th width="200">ワンちゃんの名前</th><th width="200">コメント</th></tr>
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
<?php foreach ($stmt as $g) {
|
20
|
+
|
21
|
+
$codo=$g['code'];
|
22
|
+
|
23
|
+
$name=$g['name'];
|
24
|
+
|
25
|
+
$comment=$g['comment'];
|
26
|
+
|
27
|
+
|
2
28
|
|
3
29
|
$img = array ('画像','画像','画像');
|
4
30
|
|
5
|
-
|
31
|
+
|
6
32
|
|
7
|
-
|
33
|
+
?> <tr>
|
8
34
|
|
35
|
+
<td><?=$codo?></td>
|
9
36
|
|
10
|
-
|
11
|
-
<
|
37
|
+
<?php
|
12
38
|
|
13
39
|
foreach($img as $i){
|
14
40
|
|
15
|
-
print "<img src={$i}>";
|
41
|
+
print "<td><img src={$i}></td>";
|
16
42
|
|
17
43
|
}
|
18
44
|
|
45
|
+
?>
|
46
|
+
|
47
|
+
<td><?=$name?></td>
|
48
|
+
|
49
|
+
<td><?=$comment?></td></tr>
|
50
|
+
|
19
|
-
|
51
|
+
</table>
|
52
|
+
|
53
|
+
|
20
54
|
|
21
55
|
```
|
22
56
|
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,11 +2,21 @@
|
|
2
2
|
|
3
3
|
$img = array ('画像','画像','画像');
|
4
4
|
|
5
|
+
<table>でテーブル作成します
|
6
|
+
|
7
|
+
省略
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
<td><?php
|
12
|
+
|
5
|
-
foreach($img as $i){
|
13
|
+
foreach($img as $i){
|
6
14
|
|
7
15
|
print "<img src={$i}>";
|
8
16
|
|
9
17
|
}
|
18
|
+
|
19
|
+
?></td>
|
10
20
|
|
11
21
|
```
|
12
22
|
|