Jump to content

Forum categorys


Arbitus

Recommended Posts

So I'm working on this forum and I got stuck again.

 

I'm trying to do what (pretty much all forums do) and have it so their are categorys, and under the categorys their are boards

 

-category

--Board

--Board

-category

--board

 

You get the picture. So anyways, I'm having a hard time figuring out how to make it so the right boards show under the right category. This is the little clutter I have so far. I'm sure it makes no sense, and I know it would not work. But maybe you guys can show me how to modify it to work.

 

while($catrows = mysql_fetch_array($catquery)) {
?>
	<table width="100%" border="0">
	<tr>
	<td>
	<h3><?php echo $catname; ?></h3>
	</td>
	<tr>
	<td>
<table width="100%" border="0">
<?php
// Display our boards
while($boardrows = mysql_fetch_array($boardquery)) {
?>
  <tr>
    <td width="8%" height="70"><div align="center"><?php echo $boardrows['img']; ?></div></td>
    <td width="50%">
<table width="100%" border="0">
      <tr>
        <td><a href="viewboard.php?id=<?php echo $boardrows['ID']; ?>"><?php echo $boardrows['name']; ?></a></td>
      </tr>
      <tr>
        <td height="33"><?php echo $rows['boarddesc']; ?></td>
      </tr>
    </table>
</td>
    <td width="10%"><div align="center">posts</div></td>
    <td width="18%"><div align="center">last poster</div></td>
  </tr>
  <?php
  }
?>
  	</td>
</tr>
</table>
</tr>
</table>
<?php
}
?>

 

Also, I have a cat_id field in my boards table. I just can't figure out how to make it so only the boards that are in category 1 show up in category 1 and the boards for category 2 only show up in the category 2 one. Sorry if I am confusing...I seem to do that a lot.

Link to comment
https://forums.phpfreaks.com/topic/136983-forum-categorys/
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.