Jump to content

Why doesn't this work? :S


Andy11548

Recommended Posts

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.