Hi!
How to make a forum? I started to make a forum, I created a tables called forums and topics. The I created everything so far that I can post a post in any forum and it I can view it, but the problem is replys. How can I add reply? do i need to create new table? Please give me some tips how to make forum database!! Thank you!
Need tips for Forum Database
Moderator: General Moderators
- launchcode
- Forum Contributor
- Posts: 401
- Joined: Tue May 11, 2004 7:32 pm
- Location: UK
- Contact:
- johnperkins21
- Forum Contributor
- Posts: 140
- Joined: Mon Oct 27, 2003 4:57 pm
I thought about creating my own forum a while ago and downloaded phpBB just to see how they did it. Needless to say, I went ahead and just used phpBB on my site. They have put a lot of time and effort into creating a very good piece of forum software that works very well. If you want to do it just for the learning aspect, do as launchode suggest and look at their structure. They use 29 tables, but 3 of those are just for the polling system.
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
Re: Need tips for Forum Database
table "posts":yosuke_ wrote:Hi!
How to make a forum? I started to make a forum, I created a tables called forums and topics. The I created everything so far that I can post a post in any forum and it I can view it, but the problem is replys. How can I add reply? do i need to create new table? Please give me some tips how to make forum database!! Thank you!
postid | postmsg | post_user | post_date | topicid
table "topics":
topicid | name | description | poster
Code: Select all
$result = mysql_query("SELECT * FROM posts WHERE topicid = " . $_GET['tid']);
while($row = mysql_fetch_array($result)){
$result2 = mysql_query("SELECT * FROM members WHERE username = " . $row[username]);
$row2 = mysql_fetch_array($result);
echo '<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top" width="80">';
echo "<b>" .$row[username]. "</b><br />";
echo "<b>" .$row2[title]. "</b><br />";
echo "Date: " .$row[date]. "<br />";
echo "</td><td width="*" valign="top">" .$row[postmsg]. "</td></tr></table>";
}