Help with this 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: Help with this query .... (/showthread.php?tid=2002) |
Help with this query .... - El Forum - 07-11-2007 [eluser]Unknown[/eluser] Hi every: I'm developing a web application and now I'm in a crash point. I have two tables. Basically they have this fields: Code: smp_catgaleria Code: $idc = $this->gal_model->getCategories(); Help with this query .... - El Forum - 07-11-2007 [eluser]Rick Jolly[/eluser] As long as every top level category has only one level of subcategories, your example code is almost there. Maybe create a menu array that looks something like this: Code: $array_menu = array(); If you need multiple levels of subcategories you'll need to use recursion. Check out examples of "Adjacency List". You could also use "Nested Sets" which are more complicated. There are CI examples of both methods out there. Help with this query .... - El Forum - 07-11-2007 [eluser]Unknown[/eluser] Thanks Rick I check and come back later if I have any problem. Cheers |