title: No response data available for this request after POST requests in AJAX
body: <p>I used AJAX POST request to fill my datatable. In my php file, i have a query and store it on array and return as json. But it returns "No response data available for this request" even though the fields are the same in php and database. If I include UserName error will occur. Please help me fix this one.</p>
  
  <p>I already alter my Database field name from UserName to username but still won't work.</p>
  
  <p><strong>PHP File. (user_action.php)</strong></p>
  
  <pre><code>if ($_POST["action"] == 'fetch') {
      $query = "SELECT * FROM userslist ";
      if (isset($_POST["search"]["value"])) {
          $query .= 'WHERE UserName LIKE "%' . $_POST["search"]["value"] . '%" ';
      }
      if (isset($_POST["order"])) {
          $query .= 'ORDER BY ' . $_POST['order']['0']['column'] . ' ' . $_POST['order']['0']['dir'] . ' ';
      } else {
          $query .= 'ORDER BY id DESC ';
      }
      if ($_POST["length"] != -1) {
          $query .= 'LIMIT ' . $_POST['start'] . ', ' . $_POST['length'];
      }
  
      $statement = $connect-&gt;prepare($query);
      $statement-&gt;execute();
      $result = $statement-&gt;fetchAll();
      // var_dump($result);
      // exit();
      $data = array();
      $filtered_rows = $statement-&gt;rowCount();
      foreach ($result as $row) {
          // var_dump($row["window"]);
          // exit();
          $sub_array = array();
          $sub_array[] = $row["id"];
          $sub_array[] = $row['UserName'];
          $sub_array[] = $row["UserDesignation"];
          $sub_array[] = $row["UserType"];
          $sub_array[] = $row["UserDesc"];
          $sub_array[] = $row["status"];
          $sub_array[] = $row["window"];
          $sub_array[] = '&lt;button type="button" name="edit_user" class="btn btn-primary btn-sm edit_user" id="' . $row["id"] . '"&gt;&lt;i class="fa fa-pencil"&gt;&lt;/i&gt; Edit&lt;/button&gt; &lt;button type="button" name="delete_user" class="btn btn-danger btn-sm delete_user" id="' . $row["id"] . '"&gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt; Delete&lt;/button&gt;';
          $data[] = $sub_array;
      }
  
      $output = array(
          "draw"    =&gt; intval($_POST["draw"]),
          "recordsTotal"  =&gt;  $filtered_rows,
          "recordsFiltered" =&gt; get_total_records($connect, 'userslist'),
          "data"    =&gt; $data
      );
      echo json_encode($output);
  }
  </code></pre>
  
  <p><strong>AJAX (user.php)</strong></p>
  
  <pre><code>var dataTable = $('#user_table').DataTable({
      "processing": true,
      "serverSide": true,
      "order": [],
      "ajax": {
          url: "dal/user_action.php",
          type: "POST",
          data: {
              action: 'fetch'
          }
          // dataType: "json",
          // error: function(result) {
          //     alert(result);
          // }0
      },
      "columnDefs": [{
          "targets": [0, 1, 2, 3, 4, 5, 6],
          // "targets": [0, 1, 2, 3, 4, 5, 6, 7],
          "orderable": false,
      }, ],
  });
  </code></pre>
  
  <p><strong>Errors:</strong></p>
  
  <blockquote>
    <p>DataTables warning: table id=user_table - Invalid JSON response. For more information about this error, please see <a href="http://datatables.net/tn/1" rel="nofollow noreferrer">http://datatables.net/tn/1</a></p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>No response data available for this request</p>
  </blockquote>