title: Autosuggest in textbox using php
body: <p>Whenever I input letter 'a' it suggesting all the name with letter 'a' in the name_table.
  I want to to make it suggest only the name that start with letter 'a'. How to fix this?.</p>
  
  <p>index.php</p>
  
  <pre><code>&lt;html&gt;&lt;script type="text/javascript"&gt;
  $(function() {
      var availableTags = &lt;?php include('autocomplete.php'); ?&gt;;
      $("#first_name").autocomplete({
          source: availableTags,
          autoFocus:true
      });
  });
  &lt;/script&gt;
  &lt;form&gt;
  &lt;label class="w3-label w3-text-green"&gt;Name&lt;/label&gt;
  &lt;input class="w3-input w3-border" style="height: 30px" type="text" id="first_name" name = "name" required&gt;
  &lt;/form&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>autocomplete.php</p>
  
  <pre><code>&lt;?php
  require('connection.php');
  $sql = "select name from employee";
  $result = mysqli_query($conn, $sql) or die("Error " .
  mysqli_error($connection));
  
  $dname_list = array();
  while($row = mysqli_fetch_array($result))
  {
  $fullname = $row['name'];
  
  $dname_list[] = $fullname;
  }
  echo json_encode($dname_list);
  ?&gt;
  </code></pre>