AdRock Posted April 4, 2009 Share Posted April 4, 2009 I am making a small message board with 3 tables, boards, topics and messages I can display each of the board titles, the number of topics in each board and the total number of messages. What i don't know how to do is get the username of the person who made the last post in that board and what the topic was and date (much like on the forum index on here) I thought about doing a seperate query using a mysql_insert_id() of the last record but don't know how i'd put that in my table as the table is being displayed in the main query. Is there a way I could do what i want with the query i got already? // Perform a query getting back a MySQLResult object $result = $db->query($sql); $err = $result->size(); // Include the header html require_once("header.inc.php"); if($err !=0) { echo '<table id="boards"><tr><th colspan="3">Sound Off Discussion Boards</th></tr>'; while ($row = $result->fetch()) { $boardname = ucwords($row['boardname']); echo "<tr><td><a href=''>{$boardname}</a><br />some gumf about the baord</td>"; echo "<td>{$row["message"]} Posts<br />{$row["topics"]} Topics</td>"; echo" <td></td></tr>"; } echo '</table>'; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.