Building assoc array from query - 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: Building assoc array from query (/showthread.php?tid=23320) |
Building assoc array from query - El Forum - 10-06-2009 [eluser]Unknown[/eluser] Hello fellow CI'ers! The query I'm trying to build deals with two tables: leaders and followers. I need to organize my DB query in a specific way so that I can properly display in my view in the following example format: Leader Follower Follower Follower Leader Follower Follower Follower My code is a hack job and I'm wondering if there is a better way. Especially one where there is no presentation code in the controller. Code: $query = $this->db->get('leader'); Building assoc array from query - El Forum - 10-07-2009 [eluser]InsiteFX[/eluser] Use a Model it's DATA. You are not stating were you are calling this code from etc. Enjoy InsiteFX |