Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $id = $_GET['id'];
- $query = "SELECT * FROM thread ORDER BY id ASC";
- $result = mysql_query($query) or die(mysql_error());
- $thrd = mysql_fetch_array($result);
- //--------------
- $query_for = "SELECT * FROM `forum` WHERE `id` = {$id}";
- $result_for = mysql_query($query_for) or dir(mysql_error());
- $for = mysql_fetch_array($result_for);
- if((mysql_num_rows($result) == 0) || ($for['id'] != $thrd['id'])) {
- echo 'There are no Threads in this section.! <a href="#">Create One?</a>';
- } else {
- $output_head = '
- <table class="tborder">
- <thead class="tborder">
- <tr>
- <td class="theadm" align="center" colspan="5"><p>' . $for['for_name'] . '</p></td>
- </tr>
- </thead>
- <thead class="tborder">
- <tr>
- <td colspan="5"></td>
- </tr>
- </thead>
- <tbody class="tborder">
- <tr>
- <td class="thead"> </td>
- <td class="thead" align="left">Thread/Thread Starter</td>
- <td class="thead">Last post</td>
- <td class="thead">Replies</td>
- <td class="thead">Views</td>
- </tr>
- </tbody>
- ';
- echo $output_head;
- while ($thrd = mysql_fetch_array($result)) {
- if($id == $thrd['for_id']) {
- $output = '
- <tbody class="tborder">
- <tr>
- <td class="logo"><img src="images/status.png" rel="status" /></td>
- <td width="100%" align="left">
- <a href="viewthread.php?id=' . $thrd['id'] . '">' . $thrd['thread_name'] . '</a> -<span style="font-size:11px">Admin</span>
- <br />
- <div>
- <span style="font-size:13px;text-decoration:underline">' . $thrd['thread_description'] . '</span>
- </div>
- </td>
- <td class="alt1">' . $thrd['last_post'] . '</td>
- <td class="alt1">' . $thrd['num_reply'] . '</td>
- <td class="alt1">' . $thrd['num_view'] . '</td>
- </tr>
- </tbody>
- ';
- echo $output;
- }
- } //end while loop
- } //end of else1 statement
- ?>
- </table>
Add Comment
Please, Sign In to add comment