teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

バグ修正

2015/10/25 13:35

投稿

KiyoshiMotoki
KiyoshiMotoki

スコア4791

answer CHANGED
@@ -31,7 +31,8 @@
31
31
  $placeholders = array_fill(0, count($columnList), '?');
32
32
 
33
33
  $userCode = $_POST['user_code'];
34
+ // チェックボックスが1つもチェックされていない場合、空配列を代入する。
34
- $checkbox = $_POST['checkbox'];//値を取得($checkboxは配列)
35
+ $checkbox= (isset($_POST['checkbox'])) ? $_POST['checkbox'] : array(); //値を取得($checkboxは配列)
35
36
 
36
37
  try{
37
38
  require_once('../../conf/db_con.php');