这是我的密码。。。
<fieldset>
<legend id="leg"> DAILY RECORD </legend>
<table cellpadding="12" border="5">
<tr>
<td width="7%"> <p id="allrnd"> Record Date:<br><br> <?php echo "<p> $recdate </p>"?> </p> </td>
<td width="8%"> <p id="allrnd"> Activity No.:<br><br><?php echo "<p> $actno </p>" ?> </p> </td>
<td width="6%"> <p id="allrnd"> Bldg No.:<br><br><?php echo "<p>$bldgno </p>" ?> </p> </td>
<td width="6%"> <p id="allrnd"> Floor No.:<br><br><?php echo "<p> $flrno </p>" ?> </p> </td>
<td width="6%"> <p id="allrnd"> Unit No.:<br><br><?php echo "<p> $unino </p" ?> </p> </td>
<td width="10%"> <p id="allrnd"> Type:<br><br><?php echo "<p> $type </p>" ?> </p> </td>
<td width="10.5%"> <p id="allrnd"> Specifics:<br><br> <?php echo "<p> $specs </p> " ?> </p> </td>
<td width="10%"> <p id="allrnd"> Materials Outgoing:<br><br><?php echo "<p> $mout </p>" ?> </p> </td>
<td width="10%"> <p id="allrnd"> Materials Incoming:<br><br><?php echo "<p> $min </p>" ?> </p> </td>
<td width="13%"> <p id="allrnd"> Requested By / Delivered By:<br><br><?php echo "<p> $rqstd </p>" ?> </p> </td>
<td width="8%"> <p id="allrnd"> Remarks / Name:<br><br><?php echo "<p> $rem </p>" ?> </p> </td>
<td width="5%"> <p id="allrnd"> DR No.:<br><br><?php echo "<p> $drno </p>" ?> </p> </td>
</tr>
</table>
<br>
<br>
</fieldset>
我想在一个表中显示我的所有记录,但是,它只显示每列的一条记录。
剩下的是:
<?php
$con = mysqli_connect("localhost", "root", "", "inventory");
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
$sql = "SELECT recdate, actno, bldgno, flrno, unino, type, specs, mout, min , rqstd, drno, rem FROM scaffoldingrecs";
$result = $con->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$recdate = $row["recdate"];
$actno = $row["actno"];
$bldgno= $row["bldgno"];
$flrno = $row["flrno"];
$unino = $row["unino"];
$type = $row["type"];
$specs = $row["specs"];
$mout = $row["mout"];
$min = $row["min"];
$rqstd = $row["rqstd"];
$drno = $row["drno"];
$rem = $row["rem"];
}
} else {
echo "0 results";
}
?>
1条答案
按热度按时间7gyucuyw1#
显示结果:用以下代码替换问题中的第一个代码块: