title: Search Box with autocomplete jQuery - Update
body: <p>I am trying to implement Instant Search Box with autocomplete (jQuery). The data is being fetched from database. I can see it is getting through but for some reason autocomplete is not working. </p>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;div class="ui-widget"&gt;
    &lt;label style="color: white" for="searchBar"&gt;Skills: &lt;/label&gt;
    &lt;input id="searchBar"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <h2>PHP - Slim framework</h2>
  
  <pre><code>$app-&gt;get('/ajaxsearchbox', function() {
  
      //$query = $_REQUEST['query'];
      $query = $_GET['query'];
  
      if (isset($query)) {
  
          $sql = DB::query("SELECT * FROM players WHERE playerName LIKE '%$query%'");
  
          foreach ($sql as $result[]) ;
      };
      echo json_encode(array("result" =&gt; $result));
  });
  </code></pre>
  
  <h2>jQuery</h2>
  
  <pre><code>$(document).ready(function() {
    $( "#searchBar" ).autocomplete({
      source: function(request, response) {
        $.getJSON("/ajaxsearchbox",{ query:request.term},response);
      },
      minLength: 0   
    });   
  })
  </code></pre>