![]() |
Why does it return only one data? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Why does it return only one data? (/showthread.php?tid=25131) |
Why does it return only one data? - El Forum - 12-02-2009 [eluser]shinokada[/eluser] I have the following model, control and view. It returns only one data. Could anyone point out what I am doing wrong please? Model Code: function getGalleryone(){ Control Code: function galleryone(){ View Code: foreach ($products as $key =>$product) Why does it return only one data? - El Forum - 12-02-2009 [eluser]rogierb[/eluser] You are overwriting the same variable: $data['products'] Code: $data['products'] = $row; It should be Code: $data['products'][] = $row; or Code: $data['products'][$row->id] = $row; Why does it return only one data? - El Forum - 12-02-2009 [eluser]shinokada[/eluser] Thanks rogierb. |