well i got my fourm almost up and running but i cant work out how to work the counters
http://www.dev.cossycomforts.com/forum.php you can see layouts.
<?php
$sql = "SELECT s.`id`, s.`catagory`, c.`title`, c.`about` FROM `forum-catagory` AS `s` LEFT JOIN `forum-topics` AS `c` ON s.`id` = c.`catagory_id` ORDER BY s.`id`";
$result = mysql_query($sql) or die("Query failed($sql): " . mysql_error());
print '<table width="100%" border="0" cellpadding="3" cellspacing="0" >';
?>
<tr class="purple_top"><td width="70%"><font size="+2">Welcome to the forum <?php echo $usrname ?></font></td><td width="15%"></td><td width="15%"></td></tr>
<?php
print '<tr class="purple_top"><td width="80%">Forum</td><td width="10%">Topics</td><td width="10%">Posts</td></tr>';
$last_cat = '';
$i = 0;
$m = 0;
WHILE($row = mysql_fetch_array($result)) {
if($row['catagory'] != $last_cat) {
$last_cat = $row['catagory'];
printf("<tr class=\"purple_title\"><td>%s" . "</td><td></td><td></td></tr>", $row["catagory"]);
}
if($i++ % 2)
{
print '<tr class="wight">';
}
else
{
print '<tr class="pink">';
}
printf("<td><a href=\"forum_topic.php?id=%s\">%s</a>" . "</td><td>" . "</td><td>1</td></tr>", $row["title"], $row["title"], $row["topiccount"]);
if($m++ % 2)
{
print '<tr class="wight">';
}
else
{
print '<tr class="pink">';
}
printf("<td><font size=\"-1\">%s" . "</font></td><td></td><td></td></tr>", $row["about"]);
}
print '</table>';
?>
i need it to count the number of topics, and the number of posts.
need to count subject where = topic. so there it would count all the subjects of the topics where the topic is the same
and then i need to count all the posts where in the topic feild.