Apologies for what will doubtless be a dim question.
I'm using Dreamweaver to put together an online profiling app. The questions (really, a series of statements) come from a table called "profiling_ques tions" and I want to store the answers in a table called "profile_answer s".
The user is presented with a statement, and then has to click 'agree', 'strongly disagree', etc. - 6 possible outcomes.
I want the new entry in 'profile_answer s' to include the answer (which is easy enough) but also the values of two fields in 'profiling_ques tions' that are related to the answer, but which vary depending on which question has been asked.
So if the user is asked question ID 25, and selects 'strongly agree', there are two fields in 'profiling_ques tions' for question ID 25 called 'value_control_ strag' and 'value_market_s trag' that I want to store alongside the answer in 'profile_answer s'. And similarly if the user selects 'slightly disagree' or whatever.
Dreamweaver 9's Developer Toolkit has built me a record insertion form that has several rows like this:
[code=php]$ins_profile_an swers->addColumn("ans wer", "STRING_TYP E", "POST", "answer");[/code]
the two key ones are:
[code=php]$ins_profile_an swers->addColumn("val ue_control", "DOUBLE_TYP E", "POST", "value_control" , "{questions.val ue_control_stra g}");
$ins_profile_an swers->addColumn("val ue_market", "DOUBLE_TYP E", "POST", "value_mark et", "{questions.val ue_market_strag ");[/code]
I want the {questions.valu e_control_strag } at the end to vary depending on 'answer'.
I've tried putting if ... elseif clauses around the relevant $ins_profile_an swers lines and I've also tried
[code=php]$ins_profile_an swers->addColumn("val ue_control", "DOUBLE_TYP E", "POST", "value_control" , "{questions.val ue_control_".an swer."}");[/code]
The first option entered every value as 0, the second every value as 1 (they should be either 10, 7, 3, -3, -7 or -10).
Any help very gratefully appreciated.
I'm using Dreamweaver to put together an online profiling app. The questions (really, a series of statements) come from a table called "profiling_ques tions" and I want to store the answers in a table called "profile_answer s".
The user is presented with a statement, and then has to click 'agree', 'strongly disagree', etc. - 6 possible outcomes.
I want the new entry in 'profile_answer s' to include the answer (which is easy enough) but also the values of two fields in 'profiling_ques tions' that are related to the answer, but which vary depending on which question has been asked.
So if the user is asked question ID 25, and selects 'strongly agree', there are two fields in 'profiling_ques tions' for question ID 25 called 'value_control_ strag' and 'value_market_s trag' that I want to store alongside the answer in 'profile_answer s'. And similarly if the user selects 'slightly disagree' or whatever.
Dreamweaver 9's Developer Toolkit has built me a record insertion form that has several rows like this:
[code=php]$ins_profile_an swers->addColumn("ans wer", "STRING_TYP E", "POST", "answer");[/code]
the two key ones are:
[code=php]$ins_profile_an swers->addColumn("val ue_control", "DOUBLE_TYP E", "POST", "value_control" , "{questions.val ue_control_stra g}");
$ins_profile_an swers->addColumn("val ue_market", "DOUBLE_TYP E", "POST", "value_mark et", "{questions.val ue_market_strag ");[/code]
I want the {questions.valu e_control_strag } at the end to vary depending on 'answer'.
I've tried putting if ... elseif clauses around the relevant $ins_profile_an swers lines and I've also tried
[code=php]$ins_profile_an swers->addColumn("val ue_control", "DOUBLE_TYP E", "POST", "value_control" , "{questions.val ue_control_".an swer."}");[/code]
The first option entered every value as 0, the second every value as 1 (they should be either 10, 7, 3, -3, -7 or -10).
Any help very gratefully appreciated.
Comment