質問編集履歴
2
DB情報
test
CHANGED
File without changes
|
test
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
よろしくお願いいたします。
|
14
14
|
|
15
|
-
|
15
|
+

|
16
16
|
|
17
17
|
### 該当のソースコード
|
18
18
|
|
1
修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
配列に値をいれて結果を出力したい
|
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
ログイン機能がある予約サイトを作っています。
|
4
4
|
|
5
|
-
予約データを新しいものから順に表示させ、2個以上ある場合はページングで次へのようにページを移動して出力させたいのですが、現状
|
5
|
+
予約データを新しいものから順に表示させ、2個以上ある場合はページングで次へのようにページを移動して出力させたいのですが、現状$arr_reserveがNULLになってしまい出力ができていません。
|
6
6
|
|
7
7
|
|
8
8
|
|
@@ -16,6 +16,18 @@
|
|
16
16
|
|
17
17
|
### 該当のソースコード
|
18
18
|
|
19
|
+
```ここに言語を入力
|
20
|
+
|
21
|
+
エラーコード
|
22
|
+
|
23
|
+
Notice: Undefined index: count in C:\xampp\htdocs\reserve\shop\shop_home.php on line 40
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```
|
30
|
+
|
19
31
|
|
20
32
|
|
21
33
|
```ここに言語名を入力
|
@@ -86,30 +98,30 @@
|
|
86
98
|
|
87
99
|
$reserve_stmt->execute();
|
88
100
|
|
101
|
+
$reserve_stmt->debugDumpParams();
|
102
|
+
|
103
|
+
//結果->SQL: [52] SELECT * FROM reserve WHERE reserve_shop_id=:shop_id Params: 1 Key: Name: [8] :shop_id paramno=0 name=[8] ":shop_id" is_param=1 param_type=1
|
104
|
+
|
105
|
+
//var_dump($shop_id); ->int(4)
|
106
|
+
|
89
107
|
|
90
108
|
|
91
109
|
// reserveテーブルから予約情報の取り出し
|
92
110
|
|
93
111
|
$arr_reserve = [];
|
94
112
|
|
95
|
-
while ($row = $reserve_stmt->fetch(PDO::FETCH_ASSOC)) {
|
113
|
+
while ($row = $reserve_stmt->fetchAll(PDO::FETCH_ASSOC)) {
|
96
114
|
|
97
115
|
$arr_reserve[] = [
|
98
116
|
|
99
|
-
'count' => $row['count'],
|
117
|
+
'count' => $row['count'], <-エラー箇所
|
100
|
-
|
101
|
-
'time' => $row['time'],
|
102
|
-
|
103
|
-
'reserve_comment' => $row['reserve_comment'],
|
104
|
-
|
105
|
-
'reserve_time' => $row['reserve_time'],
|
106
|
-
|
107
|
-
'reserve_tel' => $row['reserve_tel'],
|
108
118
|
|
109
119
|
];
|
110
120
|
|
111
121
|
}
|
112
122
|
|
123
|
+
//var_dump($arr_reserve);->array(1) { [0]=> array(6) { ["count"]=> NULL ["time"]=> NULL} }
|
124
|
+
|
113
125
|
|
114
126
|
|
115
127
|
// リクエストパラメータの取得
|
@@ -122,13 +134,7 @@
|
|
122
134
|
|
123
135
|
$count = filter_input(INPUT_GET, 'count', FILTER_SANITIZE_SPECIAL_CHARS);
|
124
136
|
|
125
|
-
|
137
|
+
|
126
|
-
|
127
|
-
$reserve_time = filter_input(INPUT_GET, 'reserve_time', FILTER_SANITIZE_SPECIAL_CHARS);
|
128
|
-
|
129
|
-
$reserve_tel = filter_input(INPUT_GET, 'reserve_tel', FILTER_SANITIZE_SPECIAL_CHARS);
|
130
|
-
|
131
|
-
|
132
138
|
|
133
139
|
// 取得開始位置
|
134
140
|
|
@@ -202,7 +208,7 @@
|
|
202
208
|
|
203
209
|
<?php if ( $all['total'] > 0 ) : ?>
|
204
210
|
|
205
|
-
<p class="alert alert-success" style="text-align:center;">登録店舗数<?=
|
211
|
+
<p class="alert alert-success" style="text-align:center;">登録店舗数<?=htmlspecialchars(number_format($all['total']),ENT_QUOTES,'utf-8'); ?>件</p>
|
206
212
|
|
207
213
|
<table class="table table-striped">
|
208
214
|
|
@@ -212,8 +218,6 @@
|
|
212
218
|
|
213
219
|
<th>人数</th>
|
214
220
|
|
215
|
-
<th>時間</th>
|
216
|
-
|
217
221
|
</tr>
|
218
222
|
|
219
223
|
</thead>
|
@@ -226,8 +230,6 @@
|
|
226
230
|
|
227
231
|
<td><?= htmlspecialchars($value['count'], ENT_QUOTES, 'UTF-8'); ?></td>
|
228
232
|
|
229
|
-
<td><?= htmlspecialchars($value['time'], ENT_QUOTES, 'UTF-8'); ?></td>
|
230
|
-
|
231
233
|
<tr>
|
232
234
|
|
233
235
|
<?php endforeach; ?>
|
@@ -244,7 +246,7 @@
|
|
244
246
|
|
245
247
|
|
246
248
|
|
247
|
-
<a href="shop_home.php?shop_id=<?= $shop_id ?>search=1&count=<?= $count ?>&
|
249
|
+
<a href="shop_home.php?shop_id=<?= $shop_id ?>search=1&count=<?= $count ?>&p=<?= $p-1 ?>" class="pull-left">戻る</a>
|
248
250
|
|
249
251
|
<?php else : ?>
|
250
252
|
|
@@ -258,7 +260,7 @@
|
|
258
260
|
|
259
261
|
<?php if ( $all['total'] - (PAGE_LIMIT * $p ) > PAGE_LIMIT ) : ?>
|
260
262
|
|
261
|
-
<a href="shop_home.php?shop_id=<?= $shop_id ?>search=1&count=<?= $count ?>&
|
263
|
+
<a href="shop_home.php?shop_id=<?= $shop_id ?>search=1&count=<?= $count ?>&p=<?= $p+1 ?>" class="pull-right">次へ</a>
|
262
264
|
|
263
265
|
<?php else : ?>
|
264
266
|
|
@@ -292,28 +294,10 @@
|
|
292
294
|
|
293
295
|
<p style=""><?php echo htmlspecialchars($shop_name, ENT_QUOTES, 'UTF-8'); ?> ログイン中</p>
|
294
296
|
|
295
|
-
<a href="shop_logout.php?logout" style="">ログアウト</a>
|
296
|
-
|
297
|
-
<br>
|
298
|
-
|
299
|
-
<p style="">現在の入店可否 :<?php if($yesno == 1){
|
300
|
-
|
301
|
-
echo " 〇";
|
302
|
-
|
303
|
-
}else{
|
304
|
-
|
305
|
-
echo " ✖";
|
306
|
-
|
307
|
-
}?></p>
|
308
|
-
|
309
|
-
<p style="">コメント:<?php echo htmlspecialchars($shop_comment, ENT_QUOTES, 'UTF-8'); ?></p>
|
310
|
-
|
311
297
|
</div>
|
312
298
|
|
313
299
|
</div>
|
314
300
|
|
315
|
-
|
316
|
-
|
317
301
|
</div>
|
318
302
|
|
319
303
|
</div>
|