[eluser]Unknown[/eluser]
Hello,
I'm new with CI and I'm trying to create forum as school project. I have created database with sample info about categories and forums but I got stuck at point when I want to display cats/forums like this
Code:
------------------------------
-Category title one -
------------------------------
--forum one title -
--description -
------------------------------
--forum two title -
--description -
------------------------------
-Category title two -
------------------------------
--forum three title -
--description -
------------------------------
but I can only get this with join
Code:
------------------------------
-Category title one -
------------------------------
--forum one title -
--description -
------------------------------
-Category title one -
------------------------------
--forum two title -
--description -
------------------------------
-Category title two -
------------------------------
--forum three title -
--description -
------------------------------
I don't know how to get data from database as array of categories with array of forums. My database looks like
Code:
Cat Table
-----------
-Cat_ID -
-Cat_itle -
-----------
Forum Table
-------------
-Forum_ID -
-Par_cat_ID -
-forum_title-
-forum_descr-
-------------
Thanks for help