質問編集履歴

2

修正

2019/06/03 15:47

投稿

ariiiiiga
ariiiiiga

スコア66

test CHANGED
File without changes
test CHANGED
@@ -18,7 +18,33 @@
18
18
 
19
19
  reserveテーブル:予約が入る
20
20
 
21
-
21
+ ```ここに言語を入力
22
+
23
+ エラー
24
+
25
+ Notice: Undefined index: reserve_shop_id in C:\xampp\htdocs\reserve\shop\shop_home.php on line 20
26
+
27
+
28
+
29
+ Notice: Undefined index: count in C:\xampp\htdocs\reserve\shop\shop_home.php on line 21
30
+
31
+
32
+
33
+ Notice: Undefined index: time in C:\xampp\htdocs\reserve\shop\shop_home.php on line 22
34
+
35
+
36
+
37
+ Notice: Undefined index: reserve_comment in C:\xampp\htdocs\reserve\shop\shop_home.php on line 23
38
+
39
+
40
+
41
+ Notice: Undefined index: reserve_time in C:\xampp\htdocs\reserve\shop\shop_home.php on line 24
42
+
43
+
44
+
45
+ Notice: Undefined index: reserve_tel in C:\xampp\htdocs\reserve\shop\shop_home.php on line 25
46
+
47
+ ```
22
48
 
23
49
  ### 該当のソースコード
24
50
 

1

修正

2019/06/03 15:47

投稿

ariiiiiga
ariiiiiga

スコア66

test CHANGED
File without changes
test CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  ini_set("display_errors",1);
34
34
 
35
- define('PAGE_LIMIT', 10);
35
+ define('PAGE_LIMIT', 2);
36
36
 
37
37
 
38
38
 
@@ -88,13 +88,13 @@
88
88
 
89
89
  $reserve_stmt->execute();
90
90
 
91
-
91
+ //var_dump($shop_id); ->int(4)
92
92
 
93
93
  // 予約情報の取り出し
94
94
 
95
95
  $arr_reserve = [];
96
96
 
97
- while ($rows = $reserve_stmt->fetch(PDO::FETCH_ASSOC)) {
97
+ while ($rows = $reserve_stmt->fetchAll(PDO::FETCH_ASSOC)) {
98
98
 
99
99
  $arr_reserve[] = [
100
100
 
@@ -118,14 +118,6 @@
118
118
 
119
119
  $name = filter_input(INPUT_GET, 'name', FILTER_SANITIZE_SPECIAL_CHARS);
120
120
 
121
- $shop = filter_input(INPUT_GET, 'shop', FILTER_SANITIZE_SPECIAL_CHARS);
122
-
123
- $user_id = filter_input(INPUT_GET, 'user_id', FILTER_SANITIZE_SPECIAL_CHARS);
124
-
125
- $time = filter_input(INPUT_GET, 'time', FILTER_SANITIZE_SPECIAL_CHARS);
126
-
127
- $count = filter_input(INPUT_GET, 'count', FILTER_SANITIZE_SPECIAL_CHARS);
128
-
129
121
  $reserve_comment = filter_input(INPUT_GET, 'reserve_comment', FILTER_SANITIZE_SPECIAL_CHARS);
130
122
 
131
123
  $reserve_time = filter_input(INPUT_GET, 'reserve_time', FILTER_SANITIZE_SPECIAL_CHARS);
@@ -138,18 +130,6 @@
138
130
 
139
131
  $offset = $p * PAGE_LIMIT;
140
132
 
141
- // SQL生成
142
-
143
- $where = [];
144
-
145
- $whereSql = null;
146
-
147
- if ( $name ) {
148
-
149
- $where[] = "name like :name";
150
-
151
- }
152
-
153
133
 
154
134
 
155
135
  $sql = $pdo->prepare('select SQL_CALC_FOUND_ROWS * from reserve '.$whereSql.' order by reserve_time desc limit :limit offset :offset');
@@ -164,12 +144,6 @@
164
144
 
165
145
 
166
146
 
167
- // 結果取得
168
-
169
- $result = $sql->fetchAll();
170
-
171
-
172
-
173
147
  // Total件数
174
148
 
175
149
  $totalRow = $pdo->query("SELECT FOUND_ROWS() as total");