title: How to get result based on 2 query in CI
body: <p>sorry for the confusing title as I really did not know what to type. I'm new to CI and now I'm trying to convert my code to CI and stuck here.</p>
  
  <p>here is my original code:</p>
  
  <pre><code>$query_domain = $konek-&gt;prepare("SELECT * FROM `domain` WHERE `id` = :id");
  $query_domain-&gt;bindParam(":id", $id);
  $query_domain-&gt;execute();
  $data_domain = $query_domain-&gt;fetch();
  
  $query_owner = $konek-&gt;query("SELECT * FROM `people` WHERE `id` = $data_domain-&gt;ownerid");
  $data_owner = $query_owner-&gt;fetch();
  </code></pre>
  
  <p>So basically it request a domain where the domain id is X
  and then it request data of the owner based on an owner id that is in domain table.</p>
  
  <p>I'm not really sure what to put in <strong>controller or model</strong>
  but here is my current model:</p>
  
  <pre><code>    public function get_domain($id){
      $this-&gt;db-&gt;get_where('domain', array('id' =&gt; $id));
  }
  
  public function get_domain_owner($ownerid){
      $this-&gt;db-&gt;get_where('client', array('id' =&gt; $ownerid));
  }
  </code></pre>