<tr> <th>Topic</th> <th>Created at</th> </tr>'; while($row = mysql_fetch_assoc($result)) { echo '<tr>'; echo '<td class="leftpart">'; echo '<h3><a href="topic.php?id=' . $row['topic_id'] . '">' . $row['topic_subject'] . '</a><br /><h3>'; echo '</td>'; echo '<td class="rightpart">'; echo date('d-m-Y', strtotime($row['topic_date'])); echo '</td>'; echo '</tr>'; } */ while ($row = mysql_fetch_assoc($result)) { $id = $row['topic_id']; $tpic = new TopicController($id); $title = "<a href=\"topic.php?id=" . $id . "\">" . $row['topic_subject'] . "</a>"; $creator = $tpic->getCreator(); $replyCount = $tpic->getReplyCount(); $lastUpdate = $tpic->getLastUpdate(); // List of topics echo "<div class=\"topic\" id=\"usertopic\">\r\n\t\t<div id=\"name\">{$title}</div>\r\n\t\t<div id=\"created-by\">{$creator}</div>\r\n\t\t<div id=\"reply-count\">{$replyCount}</div>\r\n\t\t<div id=\"last-update\">{$lastUpdate}</div>\r\n\t</div>"; } } echo "<br><a href='thread.php?topic={$id}'>Create post</a><br>"; //Close the category container echo "\n</div>";