I am having problem in submitting this form when I select "1" on the number of setting in html form. The submit button is working if I select 2 in the number of sitting from html form as it will show all the form fields but when I select 1, submit form is not working. I am new to PHP

This is my html form

<form name="register" method="POST" action="process.php">
<label>Select Number of Sitting(s)</label>
<select name="sitting" id="sitting" class="form-control" onchange="showDiv(this)">
    <option value="1">1</option>
    <option value="2">2</option>
</select>
<div class="output1" id="div1" name="onesitting">
<label>School Name</label>
<input type="text" name="schoolname[]" id="schoolname1" class="form-control" placeholder="School Name" required>
<label>Exam Type</label>
<select name="examboard[]" id="examboard1" class="form-control" required>
    <option value="">Exam Type</option>
    <option value="WAEC">WAEC(SSCE)</option>
     <option value="WAEC">WAEC(GCE)</option>
        </select>
    </div>
<div class="form2a" id="div2a" name="twositting">
<h4 style="text-align:center; margin-top: 10px; margin-bottom: 5%; background-color:#0d4115; width: auto; color: white;">SECOND SITTING</h4>
<label>School Name</label>
<input type="text" name="schoolname[]" id="schoolname2" class="form-control" placeholder="School Name" required>
<label>Exam Type</label>
<select name="examboard[]" id="examboard2" class="form-control" required>
<option value="">Exam Type</option>
<option value="WAEC">WAEC(SSCE)</option>
<option value="WAEC">WAEC(GCE)</option>
</select>
 </div>
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="table table-borderless" id="example">
 <tr>
            <td width="12%"><label class="control-label">S/NO</label></td>
            <td width="53%"><label class="control-label">SUBJECTS</label></td>
            <td width="35%"><label class="control-label">GRADE</label></td>
        </tr>
        <tr>
            <td>1</td>
            <td>
                <?php include("config.php");
                    $sql = "SELECT * FROM subjects ORDER BY subject_name ASC";
                    $query = mysqli_query($conn, $sql);
                    $count  = mysqli_num_rows($query);
                 ?>
                <select name="subjects[]" class="form-control" id="subject">
                    <option value="" selected="selected">Select subject</option>
                    <?php 
                        if($count > 0){
                            while($row = mysqli_fetch_assoc($query)){
                            $subject_id = $row['subject_id'];
                            $subject_name = $row['subject_name'];
                            echo "<option>" . $row['subject_name'] . "</option>";
                            }
                        }else{
                            echo "<option value = ''>Subject not available</option>";
                        }
                    ?>
                </select>
            </td>
            <td>
                <select name="grades[]" class="form-control">
                    <option value=""> Select</option>
                    <option value="A1">A1</option>
                    <option value="B2">B2</option>
                </select>
            </td> ...

I am a beginner to php and am designing student information system where students need to enter 9 subject and its corresponding grade based on the number of sittings. Is there any better way to do this apart from what I have been doing?

These are my codes:

<form name="register" method="POST" action="process2.php"  > <div class="col-md-12"> <div class="form-group"> <label>Select Number of Sitting(s)</label> <select name="sitting" id="sitting" class="form-control" onchange="showDiv(this)"> <option value="1">1</option> <option value="2">2</option> </select> </div> </div> <div class="output1" id="div1" name="onesitting"> <div class="col-md-6"> <div class="form-group"> <label>School Name</label> <input type="text" name="schoolname1" id="schoolname" class="form-control" placeholder="School Name" required> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Exam Type</label> <select name="examboard1" id="examboard" class="form-control" required> <option value="">Exam Type</option> <option value="WAEC">WAEC(SSCE)</option> <option value="WAEC">WAEC(GCE)</option> <option value="NECO">NECO(SSCE)</option> <option value="NECO">NECO(GCE)</option> <option value="NABTEB">NABTEB(SSCE)</option> <option value="NABTEB">NABTEB(GCE)</option> <option value="OTHERS">OTHERS</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Exam Date</label> <?php
  $examyear = range(1960, 2050);
  ?> <select class="form-control" name="examdate1" id="examdate" placeholder="Exam Date"> <option value="">Select date</option> <?php
      foreach($examyear as $examdate){
        echo '<option value= "' .$examdate.'">'.$examdate.'</option>';
      }
?> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Exam Number</label> <input type="text" class="form-control" name="examno1" id="examno" placeholder="Exam Number"> </div> </div> <br> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table table-borderless" id="example"> <tr> <td width="12%"><label class="control-label">S/NO</label></td> <td width="53%"><label class="control-label">SUBJECTS</label></td> <td width="35%"><label class="control-label">GRADE</label></td> </tr> <tr> <td>1</td> <td> <?php include("config.php");
    $sql = "SELECT * FROM subjects ORDER BY subject_name ASC";
    $query = mysqli_query($conn, $sql);
    $count  = mysqli_num_rows($query);
?> <select name="subject11" class="form-control" id="subject"> <option value="" selected="selected">Select subject</option> <?php 
    if($count > 0){
      while($row = mysqli_fetch_assoc($query)){
        $subject_id = $row['subject_id'];
        $subject_name = $row['subject_name'];
        echo "<option>" . $row['subject_name'] . "</option>";
      }
    }else{
      echo "<option value = ...