How To Create A Query

Hii Yii Forum,

To my project I want to have a option called Queries. Where a user can ask a query and anyone can answer to that question. How should the query table should be? If I keep 8 columns for id, ques ,ans1 …ans6 how should i dynamically increase the size of table if there are more than 8 answers. How to fix it …

Thanks in advance…

You would have a query table and an answer table. The answer table would have a foreign key pointing to the relevant query. A highly simplified version would look like this:

Queries

id

question

Answers

id

query_id

answer

Thank you Keith