을 변경 내가 쿼리 데이터베이스에서 관련 질문을 가져와 사이트와 관련된 설문을 작성표시 쿼리 결과 섹션 ID가
mysql_select_db($database_auditing, $auditing);
$query_sections3 = sprintf("SELECT tblanswer.questionid AS answerqid,
tblanswer.answerid AS answerid,
tblanswer.answer AS answer,
tblquestion.questionid AS questionid,
tblquestion.questiontext AS questiontext,
tblquestion.questionid AS quesid,
tblquestion.questiontypeid AS questiontype,
tblquestion.sectionid AS sectionid,
tblscore.score1 AS score1,
tblscore.score2 AS score2,
tblscore.score3 AS score3,
tblscore.score3 AS score3,
tblscore.score4 AS score4,
tblhelptext.helptext AS help,
tblsection.sectionname AS sectionname
FROM tblanswer
LEFT JOIN tblquestion ON tblanswer.questionid = tblquestion.questionid
LEFT JOIN tblscore ON tblquestion.questionid = tblscore.questionid
LEFT JOIN tblhelptext ON tblquestion.questionid = tblhelptext.questionid
LEFT JOIN tblsection ON tblquestion.sectionid=tblsection.sectionid
WHERE tblanswer.auditid=%s
ORDER BY tblquestion.sectionid",
GetSQLValueString($_SESSION['auditid'], "int"));
$sections3 = mysql_query($query_sections3, $auditing) or die(mysql_error());
$totalRows_sections3 = mysql_num_rows($sections3);
에게 있습니다.
각 질문은 특정 섹션과 관련이 있습니다.
그래서 내가 뭘하려는 (그리고 비참하게 실패) 위의 쿼리에서 중첩 된 쿼리를 사용하지 않고 설문지에 사용하고있는 아코디언의 관련 부분에 나타나는 결과를 얻는 것입니다 각 div 내에서 (주어진 결과를 DB에 입력하는 데 문제가 있음).
this post에 기고 한 모든 분들께 감사드립니다.
나는 아코디언을 각자의 탭 내에서 섞어서 만들었지 만, 나는 달성하기 위해 노력하고있는 것은 동일한 탭 내에서 관련된 모든 질문을 얻는 것이다. 아코디언 DIV 년대 오히려 모든 질문보다 매번 섹션 ID 증가, 변경 얻을 위를 변경하는 방법에
<?php $prevsub='';
$purpleronnie=0;
while ($row_sections3=mysql_fetch_assoc($sections3)) {
if ($row_sections3['sectionid'] !=$prevsub) {
?>
<div class="AccordionPanel">
<div class="AccordionPanelTab"><?php echo $row_sections3['sectionname'];?></div>
<div class="AccordionPanelContent">
<br />
<h5>Please answer the questions below to the best of your ability. For help, hover over the help icon, help text will appear in the box to the right of the screen.</h5>
<?php }?>
<table class="table2" align="center">
<tr>
<th><?php echo $row_sections3['questiontext'];?> <input type="hidden" name="qnumber[]" value="<?php echo $row_sections3['questionid'];?>" />
</th>
<td>
<input type="text" name="answerid[<?php echo $purpleronnie;?>]" value="<?php echo $row_sections3['answerid'];?>" size="1" />
<?php if ($row_sections3['questiontype']=="1") { ?>
<input type="text" size="25" name="answer[<?php echo $purpleronnie;?>]" value="<?php echo $row_sections3['answer'];?>" />
<?php } ?>
</table>
</div>
</div>
<?php $purpleronnie++;
if ($prevsub!=''&&$prevsub!=$row_sections3['sectionid'])
$prevsub=$row_sections3['sectionid']; }?>
어떤 제안 :
여기에 아코디언 코드는?
많은 감사 데이브
안녕 EmmanuelG는 당신에게 당신의 응답을 많이 감사합니다! –