title: how to store checkbox item in a database through php
body: <p>i am coading huge html form which store data in database through php but my checkbox code is not working</p>
  
  <p>////check box code////</p>
  
  <pre><code>&lt;li&gt;Mother &lt;/li&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" name="mdeceased"               value="deceased"&gt;deceased&lt;/td&gt;
  &lt;td&gt;&lt;input type="checkbox" name="malive" value="alive"&gt;alive&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" name="mretired" value="retired"&gt;retired&lt;/td&gt;
  &lt;td&gt;&lt;input type="checkbox" name="minservice" value="inservice"&gt;in service&lt;/td&gt;
  &lt;td&gt;&lt;input type="checkbox" name="mbusiness" value="business"&gt;business&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>///php code for checkbox for making variable and then using in the query ///</p>
  
  <pre><code>$mysql = new mysqli('localhost','root','ramsha','scholarships_system') or die ('you\'re     dead');
  if(!empty($_POST['submit'])) {
  $mdeceased =$_POST['mdeceased'];
  $malive = $_POST['malive'];
  $mretired = $_POST['mretired'];
  $minservice = $_POST['minservice'];
  $mbusiness = $_POST['mbusiness'];
  
  
  $query = "INSERT INTO student _details      VALUES('$mdeceased','$malive','$mretired','$minservice','$mbusiness')";
  
  if($updateDb = $mysql-&gt;query($query) or die($mysql-&gt;error)) {
          echo "Congrats!";
      }
  </code></pre>
  
  <p>///error is coming ///
  Notice: Undefined index: mdeceased in C:\wamp\www\student form filling\htmlform.php on line 91</p>
  
  <p>only $alive is accepting 
  what to do</p>