title: Codeigniter Model foreach return just single record
body: <p>we are using following code in <strong>Model</strong>, we are passing one text string with different ids of album, exlode, convert it to array and we are passing array ids in foreach and foreach return as 10 to 20 different albums result, but when we call this function from Controller, its return just single 1 records, whats wrong in code?</p>
  
  <pre><code>public function get_footer_links($album_ids) {
      $album_ids = explode(',', $album_ids);
      foreach ($album_ids as $album_id) {
  
          $this-&gt;db-&gt;select('ci_albums.album_name, ci_albums.album_slug, ci_categories.cat_slug'); 
          $this-&gt;db-&gt;from('ci_albums');
          $this-&gt;db-&gt;join('ci_categories', 'ci_categories.cat_id = ci_albums.cat_id' , 'left');
          $this-&gt;db-&gt;where('album_id', $album_id);
         $results = $this-&gt;db-&gt;get()-&gt;result();
      }
  
      return $results;
  }
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;?php foreach ($footer_links as $footer_links): foreach ($footer_links as $footer_link): ?&gt;
         &lt;a href="&lt;?php echo site_url() . $footer_link-&gt;cat_slug .'/'. $footer_link-&gt;album_slug .'.html'; ?&gt;" target="_blank"&gt;&lt;?php echo ucwords($footer_link-&gt;album_name); ?&gt;&lt;/a&gt; | 
      &lt;?php endforeach; endforeach; ?&gt;
  </code></pre>