0
我想在txt框中显示countNum,但不显示任何内容。计算表中的记录
我这样做。
<input type="text" value="<?php $countNum; ?>" disabled = "disabled">
<?php
$countNum = "";
$Q = mysql_query("select * from blotterreport");
while ($row = mysql_fetch_array($Q)) {
echo "<tr onclick='trClick()'>";
echo "<td>" . $row["entrynumber"] . "</td>";
echo "<td>" . $row["natureofcase"] . "</td>";
echo "<td>" . $row["month"] . " " . $row["day"] . " " . $row["year"] . "</td>";
echo "<td>" . $row["subject"] . "</td>";
echo "</tr>";
$countNum++;
}
echo $countNum;
?>
你明白,你的输出'$ countNum' __before__计数? –
这不起作用,因为在你设置'$ countNum'的时候,它没有任何价值?在运行PHP脚本之后,您应该使用类似ajax的内容来更新文本框的值。 – rbr94
第一个<?php $ countNum; ?>'必须是'<?php echo $ countNum; ?> –