title: how to update multiple checkbox
body: <p>I want to update the subject and other fields by adding multiple subjects, but the issue is it only saves one of subject which I have checked.</p>
  
  <p>How can I solve this issue ?</p>
  
  <p><strong>Below is my code :</strong></p>
  
  <pre><code>&lt;?php
  $status = "";
  if(isset($_POST['new']) &amp;&amp; $_POST['new']==1)
  {
  $host="localhost";//host name  
  $username="root"; //database username  
  $word="";//database word  
  $db_name="tuichk";//database name  
  $tbl_name="data"; //table name  
  $con=mysqli_connect("$host", "$username", "$word","$db_name")or die("cannot connect");//connection string 
  $id=$_REQUEST['id'];
  $name =$_REQUEST['name'];
  $stu_ic = $_REQUEST['stu_ic'];
  $address = $_REQUEST['address'];
  $contact = $_REQUEST['contact'];
  $checkbox1=$_REQUEST['subject'];
  $chk=""; 
  
  $update="update data set name='".$name."', stu_ic='".$stu_ic."', address='".$address."', contact='".$contact."', sub='".$checkbox1."' where id='".$id."'";
  mysql_query($update) or die(mysql_error());
  $status = "Record Updated Successfully. &lt;/br&gt;&lt;/br&gt;&lt;a href='view.php'&gt;View Updated Record&lt;/a&gt;";
  echo '&lt;p style="color:#FF0000;"&gt;'.$status.'&lt;/p&gt;';
  }else {
  ?&gt;
  </code></pre>
  
  <p>this is my html form</p>
  
  <pre><code>&lt;form name="form" method="post" action=""&gt; 
  &lt;input type="hidden" name="new" value="1" /&gt;
  &lt;input name="id" type="hidden" value="&lt;?php echo $row['id'];?&gt;" /&gt;
  &lt;p&gt;&lt;input type="text" name="name" placeholder="Enter Name" required value="&lt;?php echo $row['name'];?&gt;" /&gt;&lt;input type="text" name="stu_ic" placeholder="Enter Student IC" required value="&lt;?php echo $row['stu_ic'];?&gt;" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;input type="text" name="address" placeholder="Enter Address" required value="&lt;?php echo $row['address'];?&gt;" /&gt;&lt;input type="text" name="contact" placeholder="Enter Contact" required value="&lt;?php echo $row['contact'];?&gt;" /&gt;&lt;/p&gt;
  &lt;div style="text-align:center"&gt;
     &lt;div style="width:400px;border-radius:6px;margin:0px auto"&gt;  
  &lt;table border="1"&gt;  
     &lt;tr&gt;  
        &lt;td colspan="2"&gt;Select Subject:&lt;/td&gt;  
     &lt;/tr&gt;  
     &lt;tr&gt;  
        &lt;td&gt;Bahasa Melayu&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Bahasa Melayu"&gt;&lt;/td&gt;  
     &lt;/tr&gt;  
     &lt;tr&gt;  
        &lt;td&gt;English&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="English"&gt;&lt;/td&gt;  
     &lt;/tr&gt;  
     &lt;tr&gt;  
        &lt;td&gt;Mathematics&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Mathematics"&gt;&lt;/td&gt;  
     &lt;/tr&gt;  
     &lt;tr&gt;  
        &lt;td&gt;Science&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Science"&gt;&lt;/td&gt;  
     &lt;/tr&gt;  
     &lt;tr&gt;  
        &lt;td&gt;Sejarah&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Sejarah"&gt;&lt;/td&gt;  
     &lt;/tr&gt;
     &lt;tr&gt;  
        &lt;td&gt;Geography&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Geography"&gt;&lt;/td&gt;  
     &lt;/tr&gt;
     &lt;tr&gt;  
        &lt;td&gt;Additional Mathematics&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Additional Mathematics"&gt;&lt;/td&gt;  
     &lt;/tr&gt;
     &lt;tr&gt;  
        &lt;td&gt;Chemistry&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Chemistry"&gt;&lt;/td&gt;  
     &lt;/tr&gt;
     &lt;tr&gt;  
        &lt;td&gt;Physics&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Physics"&gt;&lt;/td&gt;  
     &lt;/tr&gt;
     &lt;tr&gt;  
        &lt;td&gt;Biology&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Biology"&gt;&lt;/td&gt;  
     &lt;/tr&gt;&lt;tr&gt;  
        &lt;td&gt;Principle Of Accounting&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Principle Of Accounting"&gt;&lt;/td&gt;  
     &lt;/tr&gt;&lt;tr&gt;  
        &lt;td&gt;Ekonomi Asas&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Ekonomi Asas"&gt;&lt;/td&gt;  
     &lt;/tr&gt;&lt;tr&gt;  
        &lt;td&gt;Perdagangan&lt;/td&gt;  
        &lt;td&gt;&lt;input type="checkbox" name="subject" value="Perdagangan"&gt;&lt;/td&gt;  
     &lt;/tr&gt;  
  &lt;/table&gt; 
  &lt;/div&gt;  
  &lt;/form&gt;
  </code></pre>