質問編集履歴

8

誤字

2017/09/03 08:26

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -344,7 +344,7 @@
344
344
 
345
345
  //プリペアドステートメント
346
346
 
347
- $stmt = $pdo->prepare("delete from country where id=? rank=?, nation=?, food=? reason=?");
347
+ $stmt = $pdo->prepare("delete from country where id=?");
348
348
 
349
349
 
350
350
 
@@ -352,40 +352,34 @@
352
352
 
353
353
  //プレースホルダに実際の値を設定する
354
354
 
355
+ $id = $_POST['id'];
356
+
355
357
  $stmt->bindParam(1, $id, PDO::PARAM_INT);
356
358
 
357
- $stmt->bindParam(2, $rank, PDO::PARAM_INT);
358
-
359
- $stmt->bindParam(3, $nation, PDO::PARAM_STR);
360
-
361
- $stmt->bindParam(4, $food, PDO::PARAM_STR);
362
-
363
- $stmt->bindParam(5, $reason, PDO::PARAM_STR);
364
-
365
- $id = $_POST['id'];
366
-
367
- $rank = $_POST['rank'];
368
-
369
- $nation = $_POST{'nation'};
370
-
371
- $food = $_POST['food'];
372
-
373
- $reason = $_POST['reason'];
374
-
375
359
  //実行する
376
360
 
377
- $stmt->execute();
361
+ $stmt->execute();
378
-
379
- //もし実行されなかったら
362
+
380
-
363
+
364
+
381
- if(!$stmt->execute()) {
365
+ if ( $stmt->execute() ) {
366
+
382
-
367
+ echo "削除成功";
368
+
369
+ } else {
370
+
383
- echo "削除失敗です。";
371
+ echo "削除失敗";
372
+
373
+ }
374
+
375
+ }
384
376
 
385
377
  }
386
378
 
387
379
 
388
380
 
381
+
382
+
389
383
  $pdo = null;
390
384
 
391
385
  }
@@ -410,6 +404,8 @@
410
404
 
411
405
 
412
406
 
407
+
408
+
413
409
  ```
414
410
 
415
411
 

7

画像の追加

2017/09/03 08:26

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -438,4 +438,4 @@
438
438
 
439
439
  ![イメージ説明](93d11e1ff713eb18bc92967b3984ccd2.png)
440
440
 
441
- ![イメージ説明](fde9a5239a989148caaef5f976efaa97.png)
441
+ ![イメージ説明](245a574fd4297c809c8157cd916694cc.png)

6

画像の追加

2017/09/03 07:53

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -438,4 +438,4 @@
438
438
 
439
439
  ![イメージ説明](93d11e1ff713eb18bc92967b3984ccd2.png)
440
440
 
441
- ![イメージ説明](4be4972a4d69768fb9842e8146863f5d.png)
441
+ ![イメージ説明](fde9a5239a989148caaef5f976efaa97.png)

5

画像の追加

2017/09/03 07:51

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -438,4 +438,4 @@
438
438
 
439
439
  ![イメージ説明](93d11e1ff713eb18bc92967b3984ccd2.png)
440
440
 
441
- ![イメージ説明](d07563148738636285095cd82d40cda0.png)
441
+ ![イメージ説明](4be4972a4d69768fb9842e8146863f5d.png)

4

画像の追加

2017/09/03 07:23

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -437,3 +437,5 @@
437
437
  ![イメージ説明](08086b998a4f2f61149d70a1bfa409e6.png)
438
438
 
439
439
  ![イメージ説明](93d11e1ff713eb18bc92967b3984ccd2.png)
440
+
441
+ ![イメージ説明](d07563148738636285095cd82d40cda0.png)

3

画像の追加

2017/09/03 07:20

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -435,3 +435,5 @@
435
435
  データベース情報
436
436
 
437
437
  ![イメージ説明](08086b998a4f2f61149d70a1bfa409e6.png)
438
+
439
+ ![イメージ説明](93d11e1ff713eb18bc92967b3984ccd2.png)

2

画像の追加

2017/09/03 07:19

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -430,4 +430,8 @@
430
430
 
431
431
  php5.4.6, mysql 14.14
432
432
 
433
+
434
+
435
+ データベース情報
436
+
433
- ![イメージ説明](e549300f7ef67e6128cc6320ff56a875.png)
437
+ ![イメージ説明](08086b998a4f2f61149d70a1bfa409e6.png)

1

画像の追加

2017/09/03 07:12

投稿

dog57
dog57

スコア131

test CHANGED
File without changes
test CHANGED
@@ -429,3 +429,5 @@
429
429
  ###補足情報(言語/FW/ツール等のバージョンなど)
430
430
 
431
431
  php5.4.6, mysql 14.14
432
+
433
+ ![イメージ説明](e549300f7ef67e6128cc6320ff56a875.png)