|
Posted by Miyagi on 07/24/07 19:01
I am creating a simple "or so I thought" php/mysql survey.
There are 3 types of Surveys, with different questions. 1 for Clients,
1 for Employees, 1 for Peers.
Questions for each survey are created, editable, removable, and drag/
drop sortable.
Options to these questions are dynamic themselves.
Basically, everything works except when I try to Insert the data into
the answers table.
The one question I'm looking for is how would one process the data
based on the respective question_id's?
Sending it to another page would require an excessive amount of _POST
variables, and like i said before, there are different questions for
each survey.
or would this work? (it doesn't seem to process)
if($submit){
for($i=$start; $i<=$end; $i++){
$query[$i] = "INSERT INTO answer(ansresult, ansdesc, idquestion,
idsurvey) VALUES('q_$i','exp_$i','$idquestion','$surveyType')";
$result[$i]= mysql_query($query[$i]);
if($result[$i]){$success++;}
}
$msg = sprintf("Success: %d, Questions: %d",$success,$end-$start);
echo($msg);
}
Any help, advice, or direction would be greatly appreciative.
- Justin Michaliga
Navigation:
[Reply to this message]
|