Are you setting up one forum, or a group of forums?<br>
<br>
If you are setting up one, basically all you need is two tables, one for questions, and one for answers.<br>
<br>
The question table should have (at minimum) columns for:<br>
Question ID (An autonumbered key index)<br>
UserName<br>
Subject<br>
Body<br>
Date<br>
<br>
The answer table should have columns for:<br>
Question ID (Referencing the question table)<br>
UserName<br>
Body<br>
Date<br>
<br>
Be sure to allow enough space in your body columns to allow your users to post without having to worry about their stuff being truncated.<br>
<br>
Posting is fairly simple. Just set up a form similar to this one.<br>
<br>
<form action=nextpage.cfm method=post><br>
<input type="text" name="UserName" size=10><br><br>
<input type="text" name="Subject" size=80><br><br>
<textarea rows=5 cols=50 name="body">post goes here</textarea><br>
<input type=submit value="submit"><br>
</form><br>
<br>
<br>
<br>
To process this form, use a query on the "nextpage.cfm" accordingly...<br>
<br>
<cfquery name="post" datasource="mydb"><br>
insert into questions (UserName,Subject,Body,Date)<br>
Values (#Form.UserName#,#Form.Subject#,#Form.Body#,#Form.Date#)<br>
</cfquery><br>
<br>
To display the questions, I would sort them descending by date, like:<br>
<br>
<cfquery name="getquestion" datasource="mydb"><br>
select * from answers<br>
order by date desc<br>
</cfquery><br>
<br>
<cfoutput query="getquestion"><br>
<p>#UserName# #Date#<br><br>
<a href="replies.cfm?QuestionID=#QuestionID#">#Subject#</a></p><br>
</cfoutput><br>
<br>
Then on replies.cfm you should output the full question, followed by the responses sorted by date ascending:<br>
<br>
<cfquery name="getquestion" datasource="mydb"><br>
select * from questions<br>
where QuestionID=#QuestionID# <!----passed from the previous page ---><br>
</cfquery><br>
<br>
<cfquery name="getreplies" datasource="mydb"><br>
select * from replies<br>
where QuestionID=#QuestionID#<br>
order by date<br>
</cfquery><br>
<br>
<cfoutput query="getquestion"><br>
#UserName# #date#<br><br>
#Subject#<br><br>
#Body#<br>
</cfoutput><br>
<cfoutput> query="getreplies" datasource="mydb"><br>
#UserName# #date#<br><br>
#Body#<br>
</cfoutput><br>
<br>
To reply to this, use a form similar to the question, but use a hidden input parameter for the questionID..<br>
<br>
<form action=nextpage.cfm method=post><br>
<cfoutput><input type="hidden" name="QuestionID" value="#getquestion.QuestionID#"></cfoutput> <!---Always remember to put paramters inside <cfoutputs>!! ---><br>
<input type="text" name="UserName" size=10><br><br>
<textarea rows=5 cols=50 name="body">post goes here</textarea><br>
<input type=submit value="submit"><br>
</form><br>
<br>
Processing this is also similar to the questions....<br>
<br>
<cfquery name="post" datasource="mydb"><br>
insert into replies (QuestionID,UserName,Body,Date)<br>
Values (#Form.QuestionID#,#Form.UserName#,#Form.Body#,#Form.Date#)<br>
</cfquery><br>
<br>
Obviously, you will need to come up with an interface to make this all look pretty...

<br>
<br>
Let me know if this helps, or if you need any further assistance...<br>
<br>
- Doug