Question: CI & Twig. Show DB results - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Question: CI & Twig. Show DB results (/showthread.php?tid=49785) |
Question: CI & Twig. Show DB results - El Forum - 03-03-2012 [eluser]josepichu[/eluser] Hi! I have a problem using CI with Twig Template engine. I want to show my DB results into my views. i have do it (i simplify it): Code: My Controller Code: My Model Code: My view - layout.php I want to show all the query results, with my code i only show the last row of my query. Help please! Question: CI & Twig. Show DB results - El Forum - 03-04-2012 [eluser]Davide Bellini[/eluser] mmmm ... check code into your model Code: while ($row = mysql_fetch_Array($result)) { with this you overwrite $data value on every loop ... use something like : Code: while ($row = mysql_fetch_Array($result)) { Question: CI & Twig. Show DB results - El Forum - 03-04-2012 [eluser]josepichu[/eluser] yes, i've do it and it works¡¡ thanks. |