title: join function only echoing 1 product of the database
body: <p>I made a model function so it will echo the products that belong to the profile user I clicked on, the thing is only the first product of that user gets echoed. For example I have an account that uploaded a total of 7 products and the function only shows the first product on the page..</p>
  
  <p>This are the model functions:</p>
  
  <pre><code>function getdata_aangeboden($user_id){
    $this-&gt;db-&gt;select("users.*,products.*"); 
    $this-&gt;db-&gt;from('users');
    $this-&gt;db-&gt;join('products','products.user_id = users.user_id','left');
    $this-&gt;db-&gt;where('users.user_id', $user_id);
    $query = $this-&gt;db-&gt;get();
    return $query-&gt;result();
   } 
  
      // Gets a list of multiple users.
   function getdata($user_id){
    $this-&gt;db-&gt;select("*"); 
    $this-&gt;db-&gt;from('users');
    $this-&gt;db-&gt;where('user_id', $user_id);
    $query = $this-&gt;db-&gt;get();
    return $query-&gt;result();
   }
  </code></pre>
  
  <p>Controller function:</p>
  
  <pre><code>&lt;?php foreach($products as $product) { ?&gt; 
    &lt;div class="main-gifts"&gt;
        &lt;a href="&lt;?php echo base_url() ?&gt;/Product/details/&lt;?php echo $product-&gt;product_id; ?&gt;"&gt;
          &lt;img id="fotos" src="&lt;?php echo base_url(); ?&gt;upload/&lt;?php echo $product-&gt;product_foto_thumb; ?&gt;"&gt;
          &lt;/a&gt;
          &lt;div class="products_discription"&gt;
              &lt;h3&gt;&lt;?php echo $product-&gt;product_naam; ?&gt;&lt;/h3&gt;
              &lt;div class="ophaal_plaats"&gt;
                  &lt;p&gt;Plaats: &lt;?php  echo $product-&gt;ophaal_plaats; ?&gt;&lt;/p&gt;
              &lt;/div&gt;
              &lt;div class="aangeboden_door"&gt;
              &lt;p&gt; &lt;?php  
                      foreach($userdetail_list as $row){ ?&gt;
                &lt;tr&gt;
                    &lt;td&gt;&lt;?php echo $row-&gt;voornaam;?&gt;&lt;/td&gt;
                 &lt;/tr&gt;
                      &lt;?php } ?&gt;&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="status"&gt;
            &lt;/div&gt;
        &lt;/div&gt;
          &lt;a href="&lt;?php echo base_url() ?&gt;/KdGwController/details_bewerken/&lt;?php echo $product-&gt;product_id; ?&gt;"&gt;&lt;input type="button" class="btn btn-default cb" value="Cadeau bewerken"&gt;&lt;/input&gt; &lt;/a&gt;
    &lt;/div&gt;
   &lt;?php } ?&gt;   
  </code></pre>
  
  <p>Can someone explain to me why it only shows 1 product and not all the products that belong to the same user_id?
  thanks</p>
  
  <p>When I print $products:</p>
  
  <pre><code>} ?&gt; Array ( [0] =&gt; stdClass Object ( [user_id] =&gt; 4 [email] =&gt; jeremy@gmail.com [voornaam] =&gt; Jeremy [achternaam] =&gt; Mathieu [straat] =&gt; [huisnummer] =&gt; 22 [postcode] =&gt; 1223lL [woonplaats] =&gt; Rotterdam [wachtwoord] =&gt; $2y$10$rO.e4j0dofAUZSWV8sP6yOHYqLzhPkRk9FjBylwbaMMmWRoCBp2oy [beschrijving] =&gt; Hallo ik ben Jeremy [geboortedatum] =&gt; 2017-06-10 [startdatum] =&gt; 2017-06-29 [geslacht] =&gt; Man [reset_password_key] =&gt; [profiel_foto] =&gt; 1498736939jeremy.jpg [product_id] =&gt; 85 [product_naam] =&gt; HIHIHIHI [product_beschrijving] =&gt; [ophaal_plaats] =&gt; ALLOVER [product_foto] =&gt; new_f5cea9c914751e0ad0048800ffec3d05.jpg [product_foto_thumb] =&gt; thumb_f5cea9c914751e0ad0048800ffec3d05.jpg [date_created] =&gt; 2017-10-25 [date_updated] =&gt; 2017-10-25 [category_id] =&gt; 2 ) [1] =&gt; stdClass Object ( [user_id] =&gt; 4 [email] =&gt; jeremy@gmail.com [voornaam] =&gt; Jeremy [achternaam] =&gt; Mathieu [straat] =&gt; [huisnummer] =&gt; 22 [postcode] =&gt; 1223lL [woonplaats] =&gt; Rotterdam [wachtwoord] =&gt; $2y$10$rO.e4j0dofAUZSWV8sP6yOHYqLzhPkRk9FjBylwbaMMmWRoCBp2oy [beschrijving] =&gt; Hallo ik ben Jeremy [geboortedatum] =&gt; 2017-06-10 [startdatum] =&gt; 2017-06-29 [geslacht] =&gt; Man [reset_password_key] =&gt; [profiel_foto] =&gt; 1498736939jeremy.jpg [product_id] =&gt; 86 [product_naam] =&gt; HUHUUHU [product_beschrijving] =&gt; [ophaal_plaats] =&gt; NOWHERE [product_foto] =&gt; new_ba2430d2b531bc421f27b5f14667cffb.jpg [product_foto_thumb] =&gt; thumb_ba2430d2b531bc421f27b5f14667cffb.jpg [date_created] =&gt; 2017-10-25 [date_updated] =&gt; 2017-10-25 [category_id] =&gt; 4 ) [2] =&gt; stdClass Object ( [user_id] =&gt; 4 [email] =&gt; jeremy@gmail.com [voornaam] =&gt; Jeremy [achternaam] =&gt; Mathieu [straat] =&gt; [huisnummer] =&gt; 22 [postcode] =&gt; 1223lL [woonplaats] =&gt; Rotterdam [wachtwoord] =&gt; $2y$10$rO.e4j0dofAUZSWV8sP6yOHYqLzhPkRk9FjBylwbaMMmWRoCBp2oy [beschrijving] =&gt; Hallo ik ben Jeremy [geboortedatum] =&gt; 2017-06-10 [startdatum] =&gt; 2017-06-29 [geslacht] =&gt; Man [reset_password_key] =&gt; [profiel_foto] =&gt; 1498736939jeremy.jpg [product_id] =&gt; 87 [product_naam] =&gt; HOHOHO [product_beschrijving] =&gt; [ophaal_plaats] =&gt; NOIDEA [product_foto] =&gt; new_e1dfb9a860859ff882d13435e796578c.jpg [product_foto_thumb] =&gt; thumb_e1dfb9a860859ff882d13435e796578c.jpg [date_created] =&gt; 2017-10-25 [date_updated] =&gt; 2017-10-25 [category_id] =&gt; 7 ) [3] =&gt; stdClass Object ( [user_id] =&gt; 4 [email] =&gt; jeremy@gmail.com [voornaam] =&gt; Jeremy [achternaam] =&gt; Mathieu [straat] =&gt; [huisnummer] =&gt; 22 [postcode] =&gt; 1223lL [woonplaats] =&gt; Rotterdam [wachtwoord] =&gt; $2y$10$rO.e4j0dofAUZSWV8sP6yOHYqLzhPkRk9FjBylwbaMMmWRoCBp2oy [beschrijving] =&gt; Hallo ik ben Jeremy [geboortedatum] =&gt; 2017-06-10 [startdatum] =&gt; 2017-06-29 [geslacht] =&gt; Man [reset_password_key] =&gt; [profiel_foto] =&gt; 1498736939jeremy.jpg [product_id] =&gt; 88 [product_naam] =&gt; HEHEHE [product_beschrijving] =&gt; [ophaal_plaats] =&gt; Korea [product_foto] =&gt; new_c080495685ed05ab5d4f8a7dcdb8e668.jpg [product_foto_thumb] =&gt; thumb_c080495685ed05ab5d4f8a7dcdb8e668.jpg [date_created] =&gt; 2017-10-25 [date_updated] =&gt; 2017-10-25 [category_id] =&gt; 8 ) [4] =&gt; stdClass Object ( [user_id] =&gt; 4 [email] =&gt; jeremy@gmail.com [voornaam] =&gt; Jeremy [achternaam] =&gt; Mathieu [straat] =&gt; [huisnummer] =&gt; 22 [postcode] =&gt; 1223lL [woonplaats] =&gt; Rotterdam [wachtwoord] =&gt; $2y$10$rO.e4j0dofAUZSWV8sP6yOHYqLzhPkRk9FjBylwbaMMmWRoCBp2oy [beschrijving] =&gt; Hallo ik ben Jeremy [geboortedatum] =&gt; 2017-06-10 [startdatum] =&gt; 2017-06-29 [geslacht] =&gt; Man [reset_password_key] =&gt; [profiel_foto] =&gt; 1498736939jeremy.jpg [product_id] =&gt; 89 [product_naam] =&gt; ugilh [product_beschrijving] =&gt; hjgluhsfkh;sidh fihsdiuhfluisdhauighsudiahguivhadsuihudisahluihvsaduihvluidsahuihv [ophaal_plaats] =&gt; Amsterdam [product_foto] =&gt; new_c6dd9fa0dc0be0830ed43940b5907115.jpg [product_foto_thumb] =&gt; thumb_c6dd9fa0dc0be0830ed43940b5907115.jpg [date_created] =&gt; 2017-10-26 [date_updated] =&gt; 2017-10-26 [category_id] =&gt; 1 ) [5] =&gt; stdClass Object ( [user_id] =&gt; 4 [email] =&gt; jeremy@gmail.com [voornaam] =&gt; Jeremy [achternaam] =&gt; Mathieu [straat] =&gt; [huisnummer] =&gt; 22 [postcode] =&gt; 1223lL [woonplaats] =&gt; Rotterdam [wachtwoord] =&gt; $2y$10$rO.e4j0dofAUZSWV8sP6yOHYqLzhPkRk9FjBylwbaMMmWRoCBp2oy [beschrijving] =&gt; Hallo ik ben Jeremy [geboortedatum] =&gt; 2017-06-10 [startdatum] =&gt; 2017-06-29 [geslacht] =&gt; Man [reset_password_key] =&gt; [profiel_foto] =&gt; 1498736939jeremy.jpg [product_id] =&gt; 93 [product_naam] =&gt; 11111 [product_beschrijving] =&gt; frfewefwe [ophaal_plaats] =&gt; 1111 [product_foto] =&gt; new_14de53777d648dcbe31dea26fa031ced.jpg [product_foto_thumb] =&gt; thumb_14de53777d648dcbe31dea26fa031ced.jpg [date_created] =&gt; 2017-10-26 [date_updated] =&gt; 2017-10-26 [category_id] =&gt; 2 ) [6] =&gt; stdClass Object ( [user_id] =&gt; 4 [email] =&gt; jeremy@gmail.com [voornaam] =&gt; Jeremy [achternaam] =&gt; Mathieu [straat] =&gt; [huisnummer] =&gt; 22 [postcode] =&gt; 1223lL [woonplaats] =&gt; Rotterdam [wachtwoord] =&gt; $2y$10$rO.e4j0dofAUZSWV8sP6yOHYqLzhPkRk9FjBylwbaMMmWRoCBp2oy [beschrijving] =&gt; Hallo ik ben Jeremy [geboortedatum] =&gt; 2017-06-10 [startdatum] =&gt; 2017-06-29 [geslacht] =&gt; Man [reset_password_key] =&gt; [profiel_foto] =&gt; 1498736939jeremy.jpg [product_id] =&gt; 94 [product_naam] =&gt; hiu;ij [product_beschrijving] =&gt; hk;h uihucuhsducuisdhuvsdphvjuisjhuvsudih [ophaal_plaats] =&gt; Amsterdam [product_foto] =&gt; new_f68becfc0741d3a2300f49ed5bcf58a5.jpg [product_foto_thumb] =&gt; thumb_f68becfc0741d3a2300f49ed5bcf58a5.jpg [date_created] =&gt; 2017-10-26 [date_updated] =&gt; 2017-10-26 [category_id] =&gt; 5 ) )
  </code></pre>