title: Autocomplete form populated by a database?
body: <p>I am currently working on a project in which I need to have an autocomplete form call its information from a db file. I have seen many tutorials on jquery autocomplete forms, but I do not know how to call a db file to populate the list.</p>
  
  <p>I am working in PHP. Currently the code represents a simple drop down box that is calling on the db file for population.</p>
  
  <pre><code>    &lt;?php
      global $wpdb;
      $depts = $wpdb-&gt;get_results( "SELECT * FROM departments ORDER BY department_name ASC" );
      echo '&lt;select&gt;';
  
      foreach($depts as $row) {
          echo '&lt;option name="select_dept" value="'.$row-&gt;department_id.'"&gt;'.$row-&gt;department_name.'&lt;/option&gt;';
      }
      echo '&lt;/select&gt;';
  ?&gt;
  </code></pre>
  
  <p>Any help would be awesome!</p>