title: I am getting Undefined Index error in process.php page
body: <p>This is my all code. I create a modal in. In modal there are two fields. one is category name and the second is a select field. I am here want to show option list from server data using ajax. I first write the code in ajax and pass the information in process.php page. In process.php i getting error undefined index. if i commented this line then everything working well </p>
  
  <pre><code>&lt;div class="modal fade" id="form_catagory" tabindex="-1" aria-labelledby="form_catagory" aria-label="true"&gt;
      &lt;div class="modal-dialog" role="document"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;h5 class="modal-title"&gt; Catagory &lt;/h5&gt;
                  &lt;button class="close" data-dismiss="modal" aria-label="close"&gt; &lt;span aria-hidden="true"&gt; 
                  &amp;times;&lt;/span&gt; &lt;/button&gt;
              &lt;/div&gt;
  
              &lt;div class="modal-body"&gt;
                  &lt;form method="post" id="form_category" onsubmit="return false"&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label for="category_name"&gt; Category name &lt;/label&gt;
                          &lt;input type="text" name="category_name" id="category_name" class="form-control" placeholder="Enter category name" /&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label for="parent_category"&gt; Parent Category &lt;/label&gt;
                          &lt;select  class="form-control" name="parent_category" id="parent_category"&gt;
                              &lt;option value="0"&gt; root &lt;/option&gt;
                          &lt;/select&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
  
              &lt;div class="modal-footer"&gt;
                  &lt;button class="btn btn-success" data-dismssiss="modal"&gt; close &lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  fetch_category();
  function fetch_category() {
      $.ajax({
      url:    var DOMAIN = "http://localhost/Inv_management/public_html";
      + "/include/process.php",
      method: "POST", 
      data: {getCategory:1},
      success: function(data) {
          console.log(data);
          $("#parent_category").html(data);
          }
  
      })
  }
  &lt;/script&gt;
  
  &lt;?php
  if($_POST["getCategory"]) {  //  I getting error here undefined index  
      $obj = new DBOperation();
      $rows = $obj-&gt;getAllRecord("categories");
      foreach($rows as $row) {
      print_r($row['category_name']);
  
      }
      exit();
  }  
  ?&gt;
  </code></pre>