title: (Codeigniter-jquery ui) Autocomplete not working
body: <p>My intension is to search users. But the autocomplete is not working for me. I would like some help on this.</p>
  
  <p>Here are my codes,</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input id="user-input" type="text" name="users" placeholder="Search User" autocomplete="on"&gt;
  </code></pre>
  
  <p><strong>Model</strong></p>
  
  <pre><code>function get_user($user) {
  
      $this-&gt;db-&gt;select('name');
      $this-&gt;db-&gt;like('name', $user);
      $query = $this-&gt;db-&gt;get('users');
  
      // echo $query; die;
  
      if($query-&gt;num_rows() &gt; 0){
          foreach($query-&gt;result_array() as $row) {
              $row_set[] = htmlentities(stripslashes($row['name']));
          }
  
          echo json_encode($row_set); 
      }
  
  }
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>public function user_search() {
  
      $this-&gt;load-&gt;model('users_model');
  
      if (isset($_GET['term'])){
          $user = strtolower($_GET['term']);
          $this-&gt;users_model-&gt;get_user($user);
      }
  
  }
  </code></pre>
  
  <p><strong>Js</strong></p>
  
  <pre><code>$(function(){
    $("#user-input").autocomplete({
      source: "site/user_search",
      minLength: 1
    });
  });
  </code></pre>
  
  <p>I am using the jquery ui version 1.12</p>