title: Getting a 'No matches' message into the following autocomplete
body: <p>As a non-developer, it's taken me some time to get this far - and as far as it goes, this jQuery autocomplete works for my purposes.
  But I'm having no luck coding it to return a 'No matches' message into the search results list.  Any guidance appreciated. I've looked at the jQuery autocomplete docs, but can't see the answer.</p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
  $(function() {
      $("#catalog").autocomplete({
          source: 'search-php.php',
          select: function(event, ui) {
              $(event.target).val(ui.item.value);
              $('#searchform').submit();
              return false;
          },
          minLength: 3
      });
  });
  </code></pre>
  
  <p>});
  </p>
  
  <pre><code>&lt;input type="search" id="catalog" name="track" size="30" maxlength="188"  maxlength="50" spellcheck="false" autocorrect="off" autocomplete="off" style="text-decoration:none;color:#fff;" placeholder="Start typing ..." autofocus&gt;
  
  
   //connect with the database
  $db = new mysqli($dbHost,$dbUsername,$dbPassword,$dbName);
  
  //get search term and then remove all hyphens, spaces and apostrophes
  $searchTerm = $_GET['term'];
  $searchTerm = str_replace('-', '', $searchTerm);
  $searchTerm = str_replace(' ', '', $searchTerm);
  $searchTerm = str_replace("'", "", $searchTerm);
  $searchTerm = str_replace(',', '', $searchTerm);
  
  //get matched data from table which ignores all hyphens, spaces and apostrophes
  $query = $db-&gt;query("SELECT track FROM bsk001_cat_ 
  WHERE replace(replace(replace(replace(track,'-',''),'\'',''),' ',''),',','')  LIKE '%$searchTerm%' 
  ORDER BY track ASC");
  while ($row = $query-&gt;fetch_assoc()) {
      $data[] = $row['track'];
  
  }
  
  //return json data
  echo json_encode($data);
  </code></pre>
  
  <p>?></p>