else { if(mysql_num_rows($topicResult) == 0) { echo 'There are no topics in this category yet.'; }
else { //display category data while($row = mysql_fetch_assoc($result)) { echo '<h2>Topics in ′' . $row['cat_name'] . '′ category</h2>'; } //do a query for the topics $topicSql = "SELECT topic_id, topic_subject, topic_date, topic_cat FROM topics WHERE 44--> topic_cat = '" . mysql_real_escape_string($_GET['topic_cat']) . "'"; $topicResult = mysql_query($topicSql); if(!$topicResult) { echo 'The topics could not be displayed, please try again later.'; } else { if(mysql_num_rows($topicResult) == 0) { echo 'There are no topics in this category yet.'; } else { //prepare the table echo '<table border="1"> <tr> <th>Topic</th> <th>Created at</th> </tr>'; while($row = mysql_fetch_assoc($topicResult)) { echo '<tr>'; echo '<td class="leftpart">'; echo '<h3><a href="topic.php?topic_id=' . $row['topic_id'] . '">' . $row['topic_subject'] . '</a><h3>'; echo '</td>'; echo '<td class="rightpart">'; echo date('d-m-Y', strtotime($row['topic_date'])); echo '</td>'; echo '</tr>'; } } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)