<?php $sql = "SELECT cat_id, cat_name, cat_description FROM categories"; $result = mysql_query($sql); if(!$result) { echo 'The categories could not be displayed, please try again later.'; } else { if(mysql_num_rows($result) == 0) { echo 'No categories defined yet.'; } else { ?> <table> <tr> <th>Category</th> <th>Last topic</th> </tr> <?php while($row = mysql_fetch_assoc($result)) { echo '<tr>'; echo '<td class="leftpart">'; echo '<h3><a href="category.php?cat_id">' . $row['cat_name'] . '</a></h3>' . $row['cat_description']; echo '</td>'; echo '<td class="rightpart">'; echo '<a href="topic.php?topic_id">Topic subject</a> at 10-10'; echo '</td>'; echo '</tr>'; echo '</table>'; } } } ?> <?php
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)