Categories and Subcategories ISSUE - 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: Categories and Subcategories ISSUE (/showthread.php?tid=60907) |
Categories and Subcategories ISSUE - El Forum - 07-28-2014 [eluser]Unknown[/eluser] I am trying to make a restaurant menu and I have to have **Categories** and **Subcategories**, so I created the following tables: Table: Categories ID NAME Table: Subcategories ID NAME PRICE DESCRIPTION CATEGORIES_ID I am using DataMapper and the problem I having with the code below is that the result of the FOREACH LOOPS I am getting is that only the LAST Subcategory is showing, where there are few more entries. So I have 2 entries each in the tables for SubCategories and the result of the code is giving me this: Quote:ALCOHOL -> VODKA and it needs to be Quote:ALCOHOL -> VODKA, AFTERSHOCK, Code: public function index() THIS IS THE VIEW: Code: {categories} Categories and Subcategories ISSUE - El Forum - 08-07-2014 [eluser]www.sblog.in[/eluser] You can get an idea http://www.webtuts.in/infinite-dynamic-multi-level-nested-category-with-php-and-mysql/ |