title: data is not submitted to database using php mysql
body: <p>I am using php and MySQL. When I submit the form data is not stored in the database table 'plantation_journal_nursery_details'.  I am badly stuck here. Can anyone please advice me that how can I solve this problem?? Thanks in advance guys. codes are given below :</p>
  
  <p>create_journal.php</p>
  
  <pre><code>&lt;form action="data_fetch.php" action="post"&gt;
                          &lt;div class="row"&gt;
                              &lt;div class="col-sm-4"&gt;
                                  &lt;h4 style="font-size: 16px;padding-left: 15px;"&gt;&lt;b&gt;Nursery Location:&lt;/b&gt;&lt;/h4&gt;&lt;br&gt;
                                  &lt;div align="right" style="padding-right: 10px;"&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Location:&lt;/label&gt;
                                      &lt;input type="text" name="location" id="location" style="width:50%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Area:&lt;/label&gt;
                                      &lt;input type="text" name="area1" id="area1" style="width:50%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;type of Nursey:&lt;/label&gt;
                                      &lt;select  name="type_of_nursery" id="type_of_nursery" style="width:50%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;
                                          &lt;option value="1"&gt;1&lt;/option&gt;
                                          &lt;option value="2"&gt;2&lt;/option&gt;
                                          &lt;option value="3"&gt;3&lt;/option&gt;
                                      &lt;/select&gt;&lt;br&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Centranl Nursery Name:&lt;/label&gt;
                                      &lt;select  name="central_nursery_name" id="central_nursery_name" style="width:40%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;
                                          &lt;option value="1"&gt;1&lt;/option&gt;
                                          &lt;option value="2"&gt;2&lt;/option&gt;
                                          &lt;option value="3"&gt;3&lt;/option&gt;
                                      &lt;/select&gt;&lt;br&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;State Nursery Name:&lt;/label&gt;
                                      &lt;input type="text"  name="state_nursery_name" id="state_nursery_name"  style="width:50%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;&lt;br&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="col-sm-4"&gt;
                                  &lt;h4 style="font-size: 16px;padding-left: 15px;"&gt;&lt;b&gt;Size of Each Bed:&lt;/b&gt;&lt;/h4&gt;&lt;br&gt;
                                  &lt;div align="right" style="padding-right: 10px;"&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Mother Bed Size:&lt;/label&gt;
                                      &lt;input type="text"  name="mother_bed_size" id="mother_bed_size"  style="width:50%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Quantity:&lt;/label&gt;
                                      &lt;input type="text" name="quantity_m" id="quantity_m" style="width:50%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Source of Seed:&lt;/label&gt;
                                      &lt;select name="source_of_seed" id="source_of_seed" style="width:50%;height: 30px; margin-left: 10px; border-radius: 5px;"&gt;
                                          &lt;option value="1"&gt;1&lt;/option&gt;
                                          &lt;option value="2"&gt;2&lt;/option&gt;
                                          &lt;option value="3"&gt;3&lt;/option&gt;
                                      &lt;/select&gt;&lt;br&gt;&lt;br&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="col-sm-4"&gt;
                                  &lt;div align="right" style="padding-right: 10px; padding-top: 40px"&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Polypot Bed Size:&lt;/label&gt;
                                      &lt;input type="text" name="polypot_bed_size" id="polypot_bed_size" style="width:42%;height: 30px; margin-left: 4px; border-radius: 5px;"&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Quantity:&lt;/label&gt;
                                      &lt;input type="text" name="quantity_p" id="quantity_p" style="width:42%;height: 30px; margin-left: 4px; border-radius: 5px;"&gt;&lt;br&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Hycopot Bed Size:&lt;/label&gt;
                                      &lt;input type="text" name="hycopot_bed_size" id="hycopot_bed_size" style="width:42%;height: 30px; margin-left: 4px; border-radius: 5px;"&gt;&lt;br&gt;
                                      &lt;label style="font-weight:300;font-size: 15px"&gt;Quantity:&lt;/label&gt;
                                      &lt;input type="text" name="quantity_h" id="quantity_h" style="width:42%;height: 30px; margin-left: 4px; border-radius: 5px;"&gt;&lt;br&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="row"&gt;
                              &lt;div align="right" style="padding-right: 10px;"&gt;
                                  &lt;input class="btn btn-info" type="submit" name="submit16" value="Add" onclick="move7()"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/form&gt;
  </code></pre>
  
  <p>data_fetch.php</p>
  
  <pre><code>    &lt;?php
  $con=mysqli_connect("localhost","root","","forestdb");
      if(isset($_POST['submit16'])){
      $location=$_POST['location'];
      $area1=$_POST['area1'];
      $type_of_nursery=$_POST['type_of_nursery'];
      $central_nursery_name=$_POST['central_nursery_name'];
      $state_nursery_name=$_POST['state_nursery_name'];
      $mother_bed_size=$_POST['mother_bed_size'];
      $quantity_m=$_POST['quantity_m'];
      $source_of_seed=$_POST['source_of_seed'];
      $polypot_bed_size=$_POST['polypot_bed_size'];
      $quantity_p=$_POST['quantity_p'];
      $hycopot_bed_size=$_POST['hycopot_bed_size'];
      $quantity_h=$_POST['quantity_h'];
  
  
      $query="SELECT plantation_journal_no from plantation_journal_basic_details where plantation_journal_no=(select max(plantation_journal_no) from plantation_journal_basic_details);";
      $res=mysqli_query($con,$query);
      $row=mysqli_fetch_assoc($res);
      $plantation_journal_no=$row['plantation_journal_no'];
      $sql="INSERT INTO `plantation_journal_nursery_details`(`plantation_journal_no`, `location`, `area`, `type_of_nursery`, `central_nursery_name`, `state_nursery_name`, `mother_bed_size`, `quantity`, `source_of_seed`, `polypot_bed_size`, `quantity_p`, `hycopot_bed_size`, `quantity_h`) VALUES ('$plantation_journal_no','$location','$area1','$type_of_nursery','$central_nursery_name','$central_nursery_name','$mother_bed_size','$quantity_m','$source_of_seed','$polypot_bed_size','$quantity_p','$hycopot_bed_size','$quantity_h');";
  
      $result=mysqli_query($con,$sql);
      if($result){
          echo "&lt;script&gt;alert('data submitted.');&lt;/script&gt;";
          header("Location:create_journal.php");
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/mCbjB.png" alt="Frontend Table"></p>
  
  <p><img src="https://i.stack.imgur.com/j3ww3.png" alt="Backend Table"></p>