質問編集履歴

1

無駄なコードを消去しました。

2016/07/14 07:06

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -140,11 +140,7 @@
140
140
 
141
141
  $nm = (string)filter_input(INPUT_POST, 'nm');
142
142
 
143
- $ndt = (string)filter_input(INPUT_POST, 'ndt');
143
+
144
-
145
- $ndt2 = (string)filter_input(INPUT_POST, 'ndt2');
146
-
147
-
148
144
 
149
145
  $dsn ='mysql:dbname=kadai;host=localhost';
150
146
 
@@ -176,25 +172,9 @@
176
172
 
177
173
  $sql .= " and name like '%$nm%' ";
178
174
 
179
- }
175
+
180
-
181
- if ($ndt != "" )
176
+
182
-
183
- {
184
-
185
- $sql .= " and ndate >= '$ndt' ";
186
-
187
- }
188
-
189
- if ($ndt2 != "" )
190
-
191
- {
192
-
193
- $sql .= " and ndate <= '$ndt2' ";
194
-
195
- }
196
-
197
- if(empty($vid)&& empty($nm) && empty($ndt)&& empty($ndt2))
177
+ if(empty($vid)&& empty($nm))
198
178
 
199
179
  {
200
180
 
@@ -218,10 +198,6 @@
218
198
 
219
199
  $data[]=$nm;
220
200
 
221
- $data[]=$ndt;
222
-
223
- $data[]=$ndt2;
224
-
225
201
  $stmt->execute($data);
226
202
 
227
203
  $count = $stmt->rowCount();
@@ -462,23 +438,9 @@
462
438
 
463
439
  }
464
440
 
465
- if ($ndt != "" )
441
+
466
-
467
- {
442
+
468
-
469
- $sql .= " and ndate >= '$ndt' ";
470
-
471
- }
472
-
473
- if ($ndt2 != "" )
474
-
475
- {
476
-
477
- $sql .= " and ndate <= '$ndt2' ";
478
-
479
- }
480
-
481
- if(empty($vid)&& empty($nm) && empty($ndt)&& empty($ndt2))
443
+ if(empty($vid)&& empty($nm))
482
444
 
483
445
  {
484
446
 
@@ -502,10 +464,6 @@
502
464
 
503
465
  $data[]=$nm;
504
466
 
505
- $data[]=$ndt;
506
-
507
- $data[]=$ndt2;
508
-
509
467
  $stmt2->execute($data);
510
468
 
511
469