Submitting a multiple checkbox form to MySql with php
<p>I have a form with multiple fields: Textinputs, Checkboxes, Radios.. and I want to submit it to a MySQL database. When I comment the checkboxes HTML, and the corresponding php code, everything is working fine, and everything is submitted and saved in the DB. If I try to submit the checkbox-form and I uncomment it, nothing get submitted, and clicking on the submit-button doesn't make any effect. </p>

<p>How can I submit the value of the checkbox-field to the MySQL-Database as a string, with the values separated with a semi-colon? For ex. if the checkbox fields are: Ab, Cd, De, Fg - and "Ab" and "De" are checked, the following string gets submitted: "Ab;Cd" </p>

<p>Here is a part of my HTML-form: </p>

<pre><code>&lt;div class="row"&gt;
    &lt;div class="col-sm-4"&gt;
        &lt;fieldset class="form-group"&gt;
            &lt;label for="plattform"&gt;Platform&lt;/label&gt;
         &lt;form id="formId"&gt;


                &lt;input type="checkbox" name="check_list[]" value="Android"&gt;Android
                &lt;input type="checkbox" name="check_list[]" value="iPhone"&gt;iPhone
                &lt;input type="checkbox" name="check_list[]" value="iPad"&gt;iPad
                &lt;input type="checkbox" name="check_list[]" value="Windows Phone"&gt;Windows Phone

            &lt;/form&gt; 

            &lt;!-- &lt;input type="checkbox" name="check_list[]" value="Android"&gt;
            &lt;input type="checkbox" name="check_list[]" value="iPhone"&gt;
            &lt;input type="checkbox" name="check_list[]" value="iPad"&gt;
            &lt;input type="checkbox" name="check_list[]" value="Windows Phone"&gt; --&gt; 

        &lt;/fieldset&gt;
    &lt;/div&gt;
    &lt;div class="col-sm-4"&gt;
        &lt;fieldset class="form-group"&gt;
            &lt;label for="featured"&gt;Featured&lt;/label&gt;
                &lt;div&gt;
                        &lt;input type="radio" name="featured" required&gt;True&lt;/input&gt;
                    &lt;/div&gt;
                    &lt;div&gt;
                    &lt;input type="radio" name="featured" required checked&gt;False&lt;/input&gt; 
                &lt;/div&gt;
        &lt;/fieldset&gt;
    &lt;/div&gt;
</code></pre>

<p>here is a sample of my php-file:</p>

<pre><code>&lt;?php /* Attempt MySQL server connection. Assuming you are running
MySQL server with default setting (user 'root' with no password) */

/* Database connection start */ 
$servername = "localhost"; 
$username = "serverName_Here"; 
$password = "password_Here"; 
$dbname = "dbName_Here";

$conn = mysqli_connect($servername, $username, $password, $dbname) or die("Connection failed: " . mysqli_connect_error());

// Check connection 
if($conn === false){
    die("ERROR: Could not connect. " . mysqli_connect_error()); 
}   
// Escape user inputs for security 
$stName = mysqli_real_escape_string($conn, $_POST['sName']); 
$lgName = mysqli_real_escape_string($conn, $_POST['lName']);
$desc = mysqli_real_escape_string($conn, $_POST['desc']);

$Platform = ''; 
if(!empty($_POST['check_list'])) {  
    $counter = 0;
    foreach($_POST['check_list'] as $check) {
        if ($counter &lt; 1) {             
            $Platform = $check;         
        } else {                
            $Platform = $excludePlatform + ';' + $check;        
        }       
        counter++;
    } 
} 
$Platform = mysqli_real_escape_string($conn, $_POST['check_list']);


$sql = "INSERT INTO tableName_Here (stName, lgName, details_description, Platform) VALUES ('$stName', '$lgName', '$desc', '$Platform')"; 

if(mysqli_query($conn, $sql)){
    echo "Records added successfully."; 
} else {
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($conn); 
}   // close connection 
mysqli_close($conn); ?&gt;
</code></pre>