Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
need advice on database design prodigy27 msg:4179407 7:44 pm on Jul 30, 2010 (gmt 0) Hi. I have a survey form where users can check multiple check boxes per question. This would be simple to build if users can only select one answer per question. My question is what is the best way to design/build this database? Thanks.
LifeinAsia msg:4179450 8:58 pm on Jul 30, 2010 (gmt 0)
Do you want to: A) match users to questions (i.e., know what answers each user chose for each question), or B) have an anonymous survey (i.e., don't care about tying answers to individual users)? If A, then the following table (called Answers) would work: UserNumber | QuestionNumber | Answer You'd probably also need a Users table for tracking: UserNumber | UserName Create 1 row in the Answers table for each answer. For example, let's say User 1 selects A & C for question 2. Your table would look like: UserNumber | QuestionNumber | Answer 1 | 2 | A 1 | 2 | C If B, then use the same logic, but drop the UserNumber field and Users table.