Ah thanks 🙂
Next question is as follows. I'm now trying to get the boards to display under their correct category but have been unable to do so. I thought a while() loop for the categories and then another while() loop inside that for the categories but it hasn't worked.
Here is the code I am currently using:
<html>
<head>
<title>Happy House Forum</title>
<style type="text/css">
.tester {display: show;
border-width: 0px;}
</style>
</head>
<body link="#000099" vlink="#000099" alink="#000099" bgcolor="#6699FF">
<center>
<table style="border-style: outset;" border="1" width="92%">
<tr>
<td width="50%" bgcolor="6699FF">
<img src="images/logo.gif" width="450" height="100">
</td>
<td width="50%" bgcolor="6699FF" align="right">
<OBJECT class="tester" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="180" HEIGHT="80" id="testenvelope" align="right">
<PARAM NAME=movie VALUE="testenvelope.swf"> <PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#6699FF>
<EMBED src="testenvelope.swf" loop=false quality=high bgcolor=#6699FF WIDTH="180" HEIGHT="80" NAME="testenvelope" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>
</td>
</tr>
<tr>
<td width="50%" align="center" bgcolor="FFFFFF">
Welcome Guest. Please <a href="login.php">login</a> or <a href="register.php">register</a>
</td>
<td width="50%" align="center" bgcolor="FFFFFF">
You have 0 unread messages
</td>
</tr>
</table>
</center>
<br><br>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="92%">
<tr>
<td width="100%" align="right">
<table style="border-style: outset;" border="1" cellspacing="1" cellpadding="3">
<tr>
<td width="100%" bgcolor="FFFFFF" align="center">
<p align="right">
<img border="0" src="images/home.gif" width="46" height="16">
<img border="0" src="images/help.gif" width="45" height="16">
<img border="0" src="images/search.gif" width="59" height="16">
<img border="0" src="images/members.gif" width="64" height="16">
<img border="0" src="images/profile.gif" width="54" height="16">
<img border="0" src="images/notification.gif" width="95" height="16"></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<br><br>
<?
$dbhost = "***";
$dbusername = "***";
$dbpassword = "***";
$database = "***";
mysql_connect($dbhost, $dbusername, $dbpassword);
mysql_select_db($database);
echo "<center>";
echo '<table cellpadding="1" cellspacing="1" border="1" width="92%" style="border-style: outset;">';
echo "<tr>";
echo '<td class="titlebg" bgcolor="333366" colspan="2" width="73%"><font color="FFFFFF"><b>Board name</b></font></td>';
echo '<td class="titlebg" bgcolor="333366" align="center" width="1%"><font color="FFFFFF"><b>Topics</b></font></td>';
echo '<td class="titlebg" bgcolor="333366" align="center" width="1%"><font color="FFFFFF"><b>Posts</b></font></td>';
echo '<td class="titlebg" bgcolor="333366" align="center" width="24%"><font color="FFFFFF"><b>Last Post</b></font></td>';
echo "</tr>";
$query = "SELECT id, name, catOrder FROM categories ORDER BY catOrder ASC";
$result = mysql_query($query);
while ($query_data = mysql_fetch_row($result))
{
$catname = $query_data[1];
echo "<tr>";
echo "<td colspan=\"5\" class=\"catbg\" bgcolor=\"666699\"><font color=\"FFFFFF\"><b>$catname<b></font></td>";
echo "</tr>";
$query = "SELECT id, name, description FROM boards";
$result = mysql_query($query);
while ($query_data = mysql_fetch_row($result))
{
$id = $query_data[0];
$name = $query_data[1];
$description = $query_data[2];
echo "<tr>";
echo '<td class="windowbg" bgcolor="FFFFFF" width="7%" align="center">';
echo "New/old post icon";
echo "</td>";
echo '<td class="windowbg2" bgcolor="FFFFFF" align="left" width="66%">';
echo "<a href=index.php?board=$id>$name</a><br>$description";
echo "</td>";
echo '<td class="windowbg" bgcolor="FFFFFF" valign="middle" align="center" width="1%">Topics</td>';
echo '<td class="windowbg" bgcolor="FFFFFF" valign="middle" align="center" width="1%">Posts</td>';
echo '<td class="windowbg2" bgcolor="FFFFFF" valign="middle" width="24%">Last post</td>';
echo "</tr>";
}
}
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<br><br>
<div align="center">
<center>
<table width="92%" border="1" style="border-style: outset;" cellspacing="1" cellpadding="1">
<tr>
<td width="100%" align="center" bgcolor="333366" colspan="2"><font color="FFFFFF"><b>Forum Statistics</b></font></td>
</tr>
<tr>
<td width="100%" bgcolor="666699" colspan="2"><font color="FFFFFF">
<b>Members</b></font></td>
</tr>
<tr>
<td width="7%" bgcolor="FFFFFF" align="center">
<img src="images/info.gif" width="20" height="20"></td>
<td width="93%" bgcolor="FFFFFF">The Happy House members have made X
threads and X posts since START DATE.<br>The newest member is NEWEST
MEMBER and there are a total of TOTAL MEMBERS.</td>
</tr>
<tr>
<td width="100%" bgcolor="666699" colspan="2">
<font color="FFFFFF"><b>Who's online</b></font></td>
</tr>
<tr>
<td width="7%" bgcolor="FFFFFF" align="center">
<img src="images/online.gif" width="20" height="20"></td>
<td width="93%" bgcolor="FFFFFF">There are X people on Happy House:<br>
X Members and X Guests<br>
List of members</td>
</tr>
</table>
</center>
</div>
</body>
</html>
And you can see the code in action here: http://www.2312.co.uk/hh/forum/index2.php
Thanks in advance for any help
Stu