开发者

What is the best way to storing and then comparing personality questions? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. 开发者_Python百科

I am working on a small dating site for my local area, and I am wondering the best way I can go about storing, retrieving, and then comparing the answers to another person. It wont just be one question, I will be creating over 1000 questions to be more specific on matches. How would I go about doing this?


Here is a database approach:

First, you need a table to hold the questions. It would have an ID column plus another column for the question text.

Then you need a table that holds user information. It would have a lot more columns, but the important one is the user ID.

Then you need a UserAnswer table to hold the users' answers. This table would have a column for user ID, a column for question ID, and a text column to hold the user's answer.

Then, when you want to retrieve a user's answers, you write a query to SELECT the answer text FROM the UserAnswer table WHERE the user ID in that table matches the ID of the user you want.

This is a very simplified version of one way to do this. I am hoping it gives you a general idea of where to start.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜