Repeating Tasks Without Repeating Projects - 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: Repeating Tasks Without Repeating Projects (/showthread.php?tid=22404) |
Repeating Tasks Without Repeating Projects - El Forum - 09-08-2009 [eluser]jshultz[/eluser] Here's the link to the code: http://stikked.com/view/8550586 It's repeating the project over and over, and I would like for it to just show the project once and then the associated tasks below it. I'm just not sure how to accomplish that though. Would there be a way to loop through the join data to just show the tasks without reprinting the project name? Repeating Tasks Without Repeating Projects - El Forum - 09-08-2009 [eluser]garymardell[/eluser] You will need to pass through a limit $this->db->limit(1); Also seems your get tasks by id has no id to work with. That function tasksByProjectId() is always going to return all the projects. Repeating Tasks Without Repeating Projects - El Forum - 09-08-2009 [eluser]jshultz[/eluser] How would that ($this->db->limit(1) work? I understand what it does, but I want to cycle through all the projects and their associated tasks. I would just like the tasks to be listed under each project without it repeating the same project over and over. In other words I want: project -task -task project 2 -task project 3 project 4 -task -task -task instead, i'm getting project -task project -task project 2 etc. etc. etc. Repeating Tasks Without Repeating Projects - El Forum - 09-08-2009 [eluser]garymardell[/eluser] Oh sorry, i thought you meant that you just wanted to show one project. My bad. You will probably have to create a temporary array using the id as the array index. Repeating Tasks Without Repeating Projects - El Forum - 09-08-2009 [eluser]jshultz[/eluser] that's exactly what I ended up doing and it worked. thanks. Here's the code thanks to ignitedcoding on the IRC channel: Code: <?php $currentProjectID = NULL; ?> |