justlukeyou Posted March 2, 2011 Share Posted March 2, 2011 Hi, I am in the process of creating a discussion board. The have section in which someone can ask a question and add notes. However, I am slighlty stuck on the reply section. So I can display the question and notes. I was planning to add fields "Answer 1" then "Answer 2" then "Answer 3" etc. However, means I have to create upto 100 fields and create response boxes for each one. Does anyone know if there is a simpler way to do this? Quote Link to comment https://forums.phpfreaks.com/topic/229353-finishing-a-discussion-board/ Share on other sites More sharing options...
trq Posted March 2, 2011 Share Posted March 2, 2011 We have discussions on this board that have thousands of replies, do you really think they are all stored alongside the initial question? No. You need to relate a 'post' to a reply. So, all posts have an id and parent_id column. Original posts have a parent_id of 0 while replies to posts have a parent_id that is equal to the original posts id. This is a simple relationship. Quote Link to comment https://forums.phpfreaks.com/topic/229353-finishing-a-discussion-board/#findComment-1181741 Share on other sites More sharing options...
justlukeyou Posted March 2, 2011 Author Share Posted March 2, 2011 Thanks, So how does the database work. I thought that all entries had to go into an individual field. How do I display each response individually? Quote Link to comment https://forums.phpfreaks.com/topic/229353-finishing-a-discussion-board/#findComment-1181790 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.