Boostrap Form with PHP, MySQL not sending data to database : <p>I've been trying to debug this for ages now and don't understand why is it not sending data to my database. Also as an indication, I'm using Boostrap and this form is inside of a modal. Can someone help me out please. I will include my html snipet as well as php code. </p>

<p>HTML CODE</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form class="form-horizontal" role="form" action="register.php" method="POST"&gt;
      &lt;div class="input-group margin-bottom-sm"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-user" aria-hidden="true"&gt;&lt;/i&gt;&lt;/span&gt;                        &lt;input class="form-control" type="text" name="fname" id="FirstName" placeholder="First Name" required&gt;
           &lt;/div&gt;&lt;/br&gt;
          
        &lt;div class="input-group"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-user" aria-hidden="true"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input class="form-control" type="text" name="lname" id="LastName" placeholder="Last Name" required&gt;
        &lt;/div&gt;&lt;/br&gt;
        
        &lt;div class="input-group"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-calendar" aria-hidden="true"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input class="form-control" type="text" name="dob" id="dob" placeholder="Date of Birth" required&gt;
        &lt;/div&gt;&lt;br&gt;
        
        &lt;div class="input-group"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-book" aria-hidden="true"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input class="form-control" type="text"  name="school" id="SchoolName" placeholder="School" required&gt;
        &lt;/div&gt;&lt;/br&gt;
    
        &lt;div class="input-group"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-user" aria-hidden="true"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input class="form-control" type="text" name="username" id="Username" placeholder="Username" required&gt;
        &lt;/div&gt;&lt;/br&gt;
      
        &lt;div class="input-group"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-lock" aria-hidden="true"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input class="form-control" type="password"  name="pass" data-minlenght= "6" id="Pass" placeholder="Password" required&gt; 
        &lt;/div&gt;&lt;div class="help-block"&gt;Minimum of 6 characters&lt;/div&gt;&lt;/br&gt;&lt;/br&gt;
        
        &lt;div class="input-group"&gt;&lt;span class="input-group-addon"&gt;&lt;i class="glyphicon glyphicon-lock" aria-hidden="true"&gt;&lt;/i&gt;&lt;/span&gt;
                    &lt;input class="form-control" type="password" id="inputPasswordConfirm" data-match="#inputPassword"
                           data-match-error="Whoops, these don't match" placeholder="Confirm" required&gt;
        &lt;/div&gt;&lt;/br&gt;
    
        &lt;div class="form-group"&gt;
        &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
        &lt;button type="submit" class="btn btn-primary" id="register"&gt;Sing Up&lt;/button&gt;
        &lt;/div&gt;
    
        &lt;/form&gt;</code></pre>
</div>
</div>
</p>

<p>PHP </p>

<pre><code>&lt;?php

$conn=mysqli_connect("localhost","mydatabase","mypassword")
    or die("Could not connect:".mysqli_error($conn));
mysqli_select_db($conn , 'mydatabase') or die ('Database will not open');

if(isset($_POST['register'])){


    $fname = ($_POST['FirstName']);  
    $lname = ($_POST['LastName']);
    $dob = ($_POST['dob']);
    $school = ($_POST['SchoolName']);
    $username = ($_POST['Username']);
    $pass = ($_POST['Pass']);


    $query = "INSERT INTO users (FirstName,LastName,dob,SchoolName,Username,Pass)VALUES('$FirstName','$LastName','$Username','$dob', '$SchoolName','$Pass',)";
    $result = mysqli_query($conn,$query);
}
?&gt;
</code></pre>
