I have a form action script. I have been struggling to find the issue. There is a problem with my insert which I cannot find.
What am I missing. When I run the script I get a HTTP 500 error
PHP
    //prepare sql and bind parameters for to insert child data
$stmt2 = $conn->prepare("INSERT INTO `Child`(`fullnames`, `idnr`, `date_of_birth`, `School`) VALUES (:Fullname, :IDNR, :DateofBirth, (SELECT `school_id` FROM `Schools` WHERE `School` = :School) )");
$stmt2->bindParam(':Fullname', $fullname);
$stmt2->bindParam(':IDNR', $idnr);
$stmt2->bindParam(':DateofBirth', $dob);
$stmt2->bindParam(':School', $school);
// insert a row - child
$fullname = $_POST['name'];
$idnr = $_POST['idnr'];
$dob = $_POST['dob'];   
$school = $_POST['school'];
$stmt2->execute();
HTML
<form action="insert_child_profile.php">
<div class="section"><span>1</span>Child's Basic detail</div>
<div class="inner-wrap">
    <label>Full Name <input type="text" name="name" required /></label>
    <label>ID Number <input type="text" name="idnr" required /></label>
    <label>Date Of Birth <input type="text" name="dob" required/></label>
</div>
   <div class="section"><span>2</span>School</div>
<div class="inner-wrap">
<div class="ui-widget">
<label>What school does the child attend<input  type="text" name="school" id="school" class="form-control" required placeholder="Enter school Name"/></label>
<div id="schoollist"></div>  
</div>
<br>
<br>
<br>
<br>
<div class="button-section">
 <input type="submit" name="Sign Up" />
    </div>
 </div>
</form>
