Jump to content

Recommended Posts

$sql2 = "SELECT f.*, c.id as cat_name, c.position as cat_position, c.name as cat_name,
mr.icon
            FROM (forum_sub_cats f, forum_cats c)
              LEFT JOIN users mr ON (mr.id=f.lpid)
            WHERE c.id=f.cid ORDER BY f.cid";
					$res2 = mysql_query($sql2) or die(mysql_error());
					while($row3 = mysql_fetch_assoc($res2)){	

echo $row3['cat_name'];									
						echo "	<a href=\".?act=forum&fid=".$row3['id']."\">".$row3['name']."</a><br>\n";
						echo "	" . $row3['desc'] . "\n Posts: ";
						echo "	</div>\n";
					}

 

Ok this spit's out:

 

27zx7yu.jpg

 

But i dont want it to spit out the category Name for every row, only ONCE Time each ..

 

Category is "24-7GT" But it spits it out 3times, only need that category once.. and the second Category is "Sub Cat #" That spits it out once cause only 1 forum, lol but if i add another forum under that category it will spit "Sub Cat # twice"

 

and I know u might just tell me to just not call it in the while function that's why, but unfortunately iuno any other way, im hoping for u guys to help me so it only spits out the Category one time FOR each forum regardless how many forums i have for each category :)

 

 

Thanks and a Merry Christmas to u if u can help ! lol

Link to comment
https://forums.phpfreaks.com/topic/186345-make-my-christmas-wish/
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.