title: how to show data with ajax using codeigniter
body: <p>i have tabel_item</p>
  <pre><code>id |    name    | location
  1  |   item a   |   3,5 
  2  |   item b   |   4
  </code></pre>
  <p>here I made a model</p>
  <pre><code>  public function db_barangGetMaster($postData){
      if(isset($postData['location']) ){
        $this-&gt;db-&gt;select(&quot;*&quot;);
        $this-&gt;db-&gt;from('tabel_item as a');
        $this-&gt;db-&gt;where(&quot;location&quot;, $postData['location']);
        
        $response = array();
        $query = $this-&gt;db-&gt;get()-&gt;result();
        foreach($query as $row ){
              $response[] = array(
              &quot;id&quot; =&gt;$row-&gt;id,
              &quot;name&quot; =&gt;$row-&gt;name,
              &quot;lokasi&quot; =&gt;$row-&gt;location
          );
        }
      if (count($response)) {
          return $response;
      } else {
          return ['response' =&gt; 'not found'];
      }}
   }
  </code></pre>
  <p>$postData  = parameter is location</p>
  <p>here as an example the content in the parameter is <strong>3</strong>
  why not show?</p>
  <p>how to display the data, if the parameter is <strong>3</strong> then what appears is <strong>item a</strong>
  if the parameter is <strong>5</strong> then <strong>item a</strong></p>