print forums under common category
<p>How would I do to print the forums under the common category?</p>

<p>Like if I have 3 forums with the same cat_id I want to print them together under the category. You understand?</p>

<p>Its hard to explain. Like this:</p>

<p>Category 1<br>
Forum 1<br>
Forum 2</p>

<p>Category 2<br>
Forum 45<br>
Forum 74<br></p>

<p>Not</p>

<p>Category 1 Forum 1<br>
Category 1 Forum 2<br></p>

<pre><code>CREATE TABLE `forums` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`forum_name` varchar(80) NOT NULL DEFAULT 'New forum',
`forum_desc` text,
`cat_id` int(10) unsigned NOT NULL DEFAULT '0'
 PRIMARY KEY (`id`)
)

CREATE TABLE `categories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`cat_name` varchar(80) NOT NULL DEFAULT 'New Category'
PRIMARY KEY (`id`)
)
</code></pre>

<p>My english is poor im sorry</p>

<pre><code>while ($row=mysql_fetch_assoc($query)) {

echo $row['cat_name'].$row['forum_name'];

}
</code></pre>
