我是一个完整的初学者,所以如果有人可以帮助我那将是非常棒的!
如何制作第4行($row[3]
)字段类型密码?
<?php
$sql = "SELECT * FROM users ORDER BY id ASC";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_array($result)) {
echo "<tr><td>" . $row["0"]. "</td><td>" . $row[1]. "</td><td>" . $row[2]."</td><td><input type='password' value=' . $row[3].' readonly='readonly'>""</td><td>" . $row[4] . "</td><td>" . $row[5] . "</td>
<td>
<a class='btn btn-success' href='edituser.php?id=" . $row[0] . "'>Update</a>
</td>";
}
?>
答案 0 :(得分:2)
您只需要解决readonly
问题。 <{1}}不需要双引号。
<td>
我还建议你下载像Netbeans或PHPStorm这样的IDE。它将有助于解决此类问题。
答案 1 :(得分:1)
有益的
<?php
$sql = "SELECT * FROM users ORDER BY id ASC";
$result = mysqli_query($conn, $sql);
echo "<table>"
while($row = mysqli_fetch_array($result))
{
echo "<tr><td>" . $row["0"]. "</td><td>" . $row[1]. "</td><td>" . $row[2]."</td><td><input type='password' value='" . $row[3]."'readonly='readonly'>""</td><td>" . $row[4]. "</td><td>" . $row[5]."</td>
<td>
<a class='btn btn-success' href='edituser.php?id=".$row[0]."'>Update</a>
</td> </tr>";
}
echo "</table>"
?>
答案 2 :(得分:-2)
<?php
$sql = "SELECT * FROM users ORDER BY id ASC";
$result = mysqli_query($conn, $sql);
echo "<table>"
while($row = mysqli_fetch_array($result))
{
echo "<tr><td>" . $row["0"]. "</td><td>" . $row[1]. "</td><td>" . $row[2]."</td><td><input type='password' value='" . $row[3]."'readonly='readonly'>""</td><td>" . $row[4]. "</td><td>" . $row[5]."</td>
<td>
<a class='btn btn-success' href='edituser.php?id=".$row[0]."'>Update</a>
</td> </tr>";
}
echo "</table>"
?>
关注并分析此代码,您会发现错误,肯定会帮助您