我是 PHP 新手,我正在研究调查和数据库。我有两张表:一张包含问题,另一张包含答案。这 2 个表具有以下属性:
_________________ _________________
| TABLE-QUESTION | | TABLE-ANSWER |
|_________________| |_________________|
| id | | id |
| survey_name | | qid |
| question | | answer |
| status | | answer_value |
|_________________| |_________________|
每个答案都有多个值并使用单选按钮选择
<?php
$newsurvey=$db->get_results("SELECT * FROM question where status='1' order by `id` ");
if($newsurvey)
{
foreach($newsurvey as $survey1)
{
?>
<h3><?php echo $survey1->question?></h3>
<?php
$slider=$db->get_results("SELECT * FROM answer where qid='$survey1->id' ");
if($slider)
{
foreach($slider as $answer1)
{
?>
<div class="entry">
<input type="radio" name='$survey1->id' value="
<?php echo $answer1->answer_value?>"/>
<?php echo $answer1->answer?>
</div>
<?php
}
}
?>
<?php
}
}
?>
<input type="Submit" value="Submit">
我想要的是将所有提交的单选按钮值汇总并存储在另一个页面中。
这个怎么做?