title: How can i group the joining table using ci jquery ajax?
body: <p><a href="https://i.stack.imgur.com/nn6tr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nn6tr.png" alt="This is the code in my index to display the output"></a>
  <a href="https://i.stack.imgur.com/Bhny6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bhny6.png" alt="please click here to view the image"></a>
  Here is my code in model: please help me to fix that thankyou in advance.
  i want is to join under of the no. 5 id look at the image for the reference.</p>
  
  <pre><code> public function showallcoddislist(){
              $company_id  = $this-&gt;input-&gt;get('company_id');
              $location_id = $this-&gt;input-&gt;get('location_id');
              $cod_id = $this-&gt;input-&gt;get('id');
  
              $this-&gt;db-&gt;distinct('A.cod_disob_id');
              $this-&gt;db-&gt;select('A.cod_disob_id,A.disob_title,B.disob,B.punish,B.num_days,B.offense,B.pun_id');       
              $this-&gt;db-&gt;order_by('A.cod_disob_id', 'asc');
              $this-&gt;db-&gt;where(array(
                          'A.company_id' =&gt; $company_id,
                          'A.location_id' =&gt; $location_id,
                          'A.cod_id' =&gt; $cod_id
                  ));
              $this-&gt;db-&gt;join("cod_disob_punish B","B.cod_disob_id = A.cod_disob_id","left outer");
  
              $query = $this-&gt;db-&gt;get('cod_disobedience A');
  
              if($query-&gt;num_rows() &gt; 0){
              return $query-&gt;result();
              }else{
                  return false;
              }
  
      }
  </code></pre>