我有一个由 php 循环在表中生成的表单。除了生成的第一个表单外,该表单工作正常。我似乎无法弄清楚为什么。这是我的代码,我是否错过了某个地方的关闭?
while($row = mysql_fetch_array($result))
{
$msisdn = $row['msisdn'];
$messageid = $row['messageid'];
echo "<tr>";
echo "<td style='width:70px;'><center>" . $row['message-timestamp'] . "</td>";
echo "<td><center>" . $row['terpname'] . "</td>";
echo "<td>";
echo "<div class='layer1'>
<p class='heading'><B><U><font size='2' color='blue'>Reply</font></u></b> </p>
<div class='content'>
<fieldset >
<form name='reply' method='post' action='reply.php'>
<textarea rows='4' cols='50' name='response' value=''></textarea>
<input type='hidden' name='phonenumber' value='$msisdn' /><BR>
<input type='hidden' name='messageid' value='$messageid' /><BR>
<input type='submit' name='search' class='btn btn-info btn-large' value='Send' />
</form>
</fieldset>
</div>
</div>
";
echo "-->" . $row['text'];
//Select responses to this text message
$sqlselect = "SELECT * FROM li_appointments.li_outbound_sms
where messageid = '" . $row['messageid'] . "';";
$subresult = mysql_query($sqlselect);
//Loop through results and display them
while($row = mysql_fetch_array($subresult))
{
echo "<BR><--" . $row['sender'] . "(" . $row['datetime'] . "): " . $row['message'];
}
echo "</td>";
echo "<td style='width:10px;'><center><input type='checkbox' class='db' onclick='resetSelectAlldb();'name='database[]', value='$messageid'></center></td>";
echo "</tr>";
}