title: 'ERR_EMPTY_RESPONSE' when using an AJAX live searchbar
body: <p>I have a live AJAX search bar that bring records from a MySQL database. However when you repeatedly search for records by changing the searchbar the web browsers throws the error 'ERR_EMPTY_RESPONSE'. </p>
  
  <blockquote>
    <p>ERR_EMPTY_RESPONSE</p>
  </blockquote>
  
  <p>If you try to refresh the page it crashes for 60 (Approx.) seconds.
  <a href="https://imgur.com/a/ghc8Zkn" rel="nofollow noreferrer">https://imgur.com/a/ghc8Zkn</a></p>
  
  <p>I'm using a GoDaddy server if it makes any differences.</p>
  
  <p>I have tried increasing the PHP memory limit to 512mb as suggested in other questions. This appeared to make no difference. </p>
  
  <p>This is my Javascript</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function()
          {
              $(".product_check").click(function()
              {
                  $("#loader").show();
  
                  var action = 'data';
                  var eventname = get_filter_text('eventname');
                  var category = get_filter_text('category');
                  var year = get_filter_text('year');
                  var num = document.getElementById('num').value;
  
                  $.ajax(
                  {
                      url:'action.php',
                      method:'POST',
                      data:{action:action, eventname:eventname, category:category, year:year, num:num}, success:function(response)
                      {
                          $("#result").html(response);
                          $("#loader").hide();
                          $("#textChange").text("Filtered Products");
                      }
                  });
              });
  
              $(".tb").keyup(function()
              {
                  $("#loader").show();
  
                  var action = 'data';
                  var eventname = get_filter_text('eventname');
                  var category = get_filter_text('category');
                  var year = get_filter_text('year');
                  var num = document.getElementById('num').value;
  
                  $.ajax(
                  {
                      url:'action.php',
                      method:'POST',
                      data:{action:action, eventname:eventname, category:category, year:year, num:num}, success:function(response)
                      {
                          $("#result").html(response);
                          $("#loader").hide();
                          $("#textChange").text("Filtered Products");
                      }
                  });
              });
  
              function get_filter_text(text_id)
              {
                  var filterData = [];
                  $('#'+text_id+':checked').each(function()
                                                 {
                      filterData.push($(this).val());
                  });
                  return filterData;
              }
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>this is my backend PHP
      
  
  <pre><code>if(isset($_POST['action']))
  {
      $sql = "SELECT * FROM tb_ETSlips WHERE eventname != ''";
  
      if(isset($_POST['eventname']))
      {
          $eventname = implode("','", $_POST['eventname']);
          $sql .= "AND eventname IN('" . $eventname . "')";
      }
      if(isset($_POST['year']))
      {
          $year = implode("','", $_POST['year']);
          $sql .= "AND year(timestamp) IN('" . $year . "')";
      }
      if(isset($_POST['category']))
      {
          $category = implode("','", $_POST['category']);
          $sql .= "AND category IN('" . $category . "')";
      }
      if(isset($_POST['num']))
      {
          $num = $_POST['num'];
          $sql .= "AND (number LIKE '%" . $num . "%' ";
          $sql .= "OR name LIKE '%" . $num . "%')";
  
      }
  
      $result = $conn-&gt;query($sql);
      $output='';
  
      if($result-&gt;num_rows&gt;0)
      {
          while ($row=$result-&gt;fetch_assoc())
          {
              $output .='&lt;tr&gt;
              &lt;td&gt;' . $row['timestamp'] . '&lt;/td&gt;
              &lt;td&gt;' . $row['number'] . '&lt;/td&gt;
              &lt;td&gt;' . $row['dname'] . '&lt;/td&gt;
              &lt;td&gt;' . $row['reaction'] . '&lt;/td&gt;
              &lt;td&gt;' . $row['et1320'] . '&lt;/td&gt;
              &lt;td&gt;' . $row['sp1320'] . '&lt;/td&gt;
              &lt;td&gt;' . $row['lane'] . '&lt;/td&gt;
              &lt;/tr&gt;';
          }
      }
      else
      {
          $output = "&lt;h3&gt;No times found!&lt;/h3&gt;";
      }
  
      echo $output;
  }
  ?&gt;
  </code></pre>