Implode (Check Box Insert) Using PHP

  <div class="form-group">
   <label for="qualification" class="col-sm-2 col-sm-offset-2 control-label">Qualification:</label>
   <div class="col-sm-5">
        <div class="checkbox-inline"><label><input type="checkbox" name="chk[]" value="BE">BE</label></div>
        <div class="checkbox-inline"><label><input type="checkbox" name="chk[]" value="ME">ME</label></div>
        <div class="checkbox-inline"><label><input type="checkbox" name="chk[]" value="MCA">MCA</label></div>
        <div class="checkbox-inline"><label><input type="checkbox" name="chk[]" value="MTECH">MTECH</label></div>
        <div class="checkbox-inline"><label><input type="checkbox" name="chk[]" value="PHD">PHD</label></div>
   </div>
 </div>
 
 
 
<!------------------In Query Part------------------------> 
 
$check=implode(',',$_POST['chk']);
 
$add=mysqli_query($connect,"insert into bws(Name,Qualification) 
    values('$sname','$check')") or die(mysqli_error($connect)); 
Previous
Next Post »