Hi!
I'm working on adding a feature to survey website, that allows the maker of the survey see the results of the survey according to
other results - so that one chart would show what women have answered, one what men, one what children, one what adults etc.
This works like this: There are 0-4 questions, which are special "background info" questions. Each of these has maximum of 5 answers. These values are passed to PHP file in following form: $_POST['tausta(number of the background question, 0-4)']. The values of these variables are numbers 0-4, which are the answer possiblities.
Then there are the regular questions, which are passed like this: $_POST['kys'(number of the question)] The values of these variables are numbers 0-4, which are the answer possiblities, too.
There are 1-40 questions, but the numbers are between 0-39. I have the regular Answers-column in the database, which has all the answers in this form: 0***0***0***0*0***|||0***0***0***0***0 where *** separates the number of answers in one answer choice, and ||| separates the questions.
I also have 20 columns made for the answers according to background, which are named pv0-pv19. The numbers mean the background answers: the answers of background question one, answer three are in pv2, question three answer one in pv10 etc.
So my problem is, how do I get the answers in the correct column correctly, when there are multiple background questions. I have spent like 10 hours working on this without finding a viable solution. As detailed descriptions (or code) as possible, please.
I'm working on adding a feature to survey website, that allows the maker of the survey see the results of the survey according to
other results - so that one chart would show what women have answered, one what men, one what children, one what adults etc.
This works like this: There are 0-4 questions, which are special "background info" questions. Each of these has maximum of 5 answers. These values are passed to PHP file in following form: $_POST['tausta(number of the background question, 0-4)']. The values of these variables are numbers 0-4, which are the answer possiblities.
Then there are the regular questions, which are passed like this: $_POST['kys'(number of the question)] The values of these variables are numbers 0-4, which are the answer possiblities, too.
There are 1-40 questions, but the numbers are between 0-39. I have the regular Answers-column in the database, which has all the answers in this form: 0***0***0***0*0***|||0***0***0***0***0 where *** separates the number of answers in one answer choice, and ||| separates the questions.
I also have 20 columns made for the answers according to background, which are named pv0-pv19. The numbers mean the background answers: the answers of background question one, answer three are in pv2, question three answer one in pv10 etc.
So my problem is, how do I get the answers in the correct column correctly, when there are multiple background questions. I have spent like 10 hours working on this without finding a viable solution. As detailed descriptions (or code) as possible, please.