Sending results from a query to another query in the controller (newbie question) - 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: Sending results from a query to another query in the controller (newbie question) (/showthread.php?tid=28855) |
Sending results from a query to another query in the controller (newbie question) - El Forum - 03-23-2010 [eluser]Juan Velandia[/eluser] Hello, I've already ask for help in this matter, but I couldn't hit the spot, so here I am again: I'm sending a query directly from the controller to the view to make a list within a list like this: placeholder 1 - section1 - section2 - section3 placeholder 2 - section4 - section5 - section This is the controller: Code: function test(){ where cms_section_content has a column placeholder Here's the view: Code: <?php foreach ($query1->result() as $row): ?> But I always get this: Message: Undefined variable: placeholder. I don’t want to pass variables via URL therefore I was thinking to put a query within the view to make the $placeholder available, but I’m sure there’s a more elegant solution, Thanks in advance for any idea! Sending results from a query to another query in the controller (newbie question) - El Forum - 03-23-2010 [eluser]Juan Velandia[/eluser] Anyone? Sending results from a query to another query in the controller (newbie question) - El Forum - 03-23-2010 [eluser]fesweb[/eluser] I don't think your code is going to do what you seem to want it to do, but maybe it's just a simplified version of what your trying to do. Code: // Is it as simple as needing to declare that var first? Sending results from a query to another query in the controller (newbie question) - El Forum - 03-23-2010 [eluser]Juan Velandia[/eluser] Hello, Fesweb I'll check it, thanks a lot!!! |