I have a table of questions for a survey, each one with its identifying number. I have a form that populates with all the questions (this is not an exact number, as more can be added) but I need to store the results into one field, using arrays, because the number of columns for a table holding the results would need to change otherwise whenever a new question is added). I have never worked with arrays but I was told this was the way to do it. I need to store the yes or no answer for a question with its number identifying the question. I also need to know how do I pull it back when I need to display the results of a particular survey, as I would need to link the number of the question to the questions table to display the actual question, and then get the answer and display it too. I have no idea where to start.
My questions table(TA_Questions) has three fields: CategoryID, QuestionID, Question and the table that holds the results(TA_Surveys) has 3 fields: EventId, UserId, Answers(this is where I need to store all the answers to the survey which can be yes,no, or blank). So far there are 29 questions in the survey. In order to display the results I need to access the questions table to get the question using the QuestionID which ideally was stored with its answer in the answers field. Can anybody help me with this code?
ArtistScope -5 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.