CodeIgniter Forums
Forum list database - 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: Forum list database (/showthread.php?tid=47311)



Forum list database - El Forum - 12-03-2011

[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