Andy11548 Posted March 3, 2012 Share Posted March 3, 2012 I've joined querys because I'm making my own forums. However, when it gets to the echoin out part, it shows the category and only ONE of the sub categorys. <div id="forumContainer"> <?php $lastboard = ''; $forumQ = mysql_query("SELECT f1.cat_name as catName, f1.cat_id as catID, f2.cat_id as subCatID, f2.sub_id as subID, f2.sub_name as subName, f2.sub_desc as subDesc FROM `forum_cats` as f1 LEFT JOIN `forum_sub` as f2 ON f1.cat_id = f2.cat_id GROUP BY f2.cat_id "); while($forumF = mysql_fetch_assoc($forumQ)) { if($forumF['catName'] != $lastboard) { echo '<div class="forumCat">'.$forumF['catName'].'</div>'; $lastboard = $forumF['catName']; } echo '<div class="forumSub">'.$forumF['subName'].'</div>'; } ?> </div> Quote Link to comment https://forums.phpfreaks.com/topic/258200-why-doesnt-this-work-s/ Share on other sites More sharing options...
Andy11548 Posted March 3, 2012 Author Share Posted March 3, 2012 Fixed Quote Link to comment https://forums.phpfreaks.com/topic/258200-why-doesnt-this-work-s/#findComment-1323541 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.