Help with listing a category tree - 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: Help with listing a category tree (/showthread.php?tid=20242) |
Help with listing a category tree - El Forum - 07-02-2009 [eluser]JayArias[/eluser] Code: <?php This code generates Tags tees What it should be generating is Tags tees sweaters pants braceletes hats problem is when I do Code: function showAll() yes it servers its purpose. But, It will generate the rows till oblivion causing my server or browser to crash. any thoughts? , I've looked through the documentation and haven't found a method. Help with listing a category tree - El Forum - 07-02-2009 [eluser]LifeSteala[/eluser] Try foreach instead of while.. Code: foreach($fetch_all->result() as $r){ href = $r->link alt = $r->description I couldn't put these two in as it breaks the code.. Help with listing a category tree - El Forum - 07-02-2009 [eluser]JayArias[/eluser] Ok, did that works but ... why is it showing up on the top of my page ... I think its because I defined it in the controller... Help with listing a category tree - El Forum - 07-02-2009 [eluser]LifeSteala[/eluser] Your model is not right still. You should not do any data manipulation in a model. Instead, a model should be used to put and get data to and from your database. It should be: Code: <?php Then in your controller catch whatever returns from showAll, and pass it through to the view via an Array. Controller: Code: class Test extends Controller { In your view, access $showall and use the foreach statement above. Help with listing a category tree - El Forum - 07-02-2009 [eluser]JayArias[/eluser] LifeSteala, Thanks very much. Works like a charm. Help with listing a category tree - El Forum - 07-02-2009 [eluser]LifeSteala[/eluser] You are most welcome. Good Luck |