Jump to content

Make my Christmas wish..


Baseball

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.