重複の可能性:
phpでmysqlクエリを行ごとに反復する方法
mysql行を繰り返し処理する必要があります。たとえば、質問IDが1の場合、すべての回答を質問1の下に表示する必要があります。私はphpの初心者ですが、誰か助けてくれませんか?
<?php
$result = select("SELECT * FROM questions WHERE question_id=1");
$row = mysql_fetch_array($result);
?>
<table width="581" height="299" border="1">
<tr>
<td>Union Assurance Questionnaire</td>
</tr>
<tr>
<td>1.<?php echo $row['questions']; ?>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<?php
$result = select("SELECT * FROM questions WHERE question_id=2");
$row = mysql_fetch_array($result);
?>
<table width="581" height="299" border="1">
<tr>
<td>2.<?php echo $row['questions']; ?>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>