为什么当我加载页面时信息不会加载到字段中?它为我提供了数据库中正确数量的行,但没有显示任何实际信息,甚至没有设置为值
<?php
$link = mysqli_connect("localhost", "root", "", "test") or die("could not connect");
if (isset($_POST['submit']) && $_POST['submit'] == 'update') {
$updateQuery = (" UPDATE `test1` SET f_name = '$_POST[f_name]', l_name='$_POST[l_name]', email='$_POST[email]' WHERE id='$_POST[id]'");
mysqli_query($link, $updateQuery);
};
$query = ("SELECT * FROM `test1`");
$result = mysqli_query($link, $query);
echo "<table border=1
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Email</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
?>
<form method="post" action="update.php">
<tr>
<td><input type="text" name="f_name" value="<?php $row['f_name'] ?>" ></td>
<td><input type="text" name="l_name" value="<?php $row['l_name'] ?>"></td>
<td><input type="text" name="email" value="<?php $row['email'] ?>"></td>
<td><input type="hidden" name="id" value="<?php $row['id'] ?>"></td>
<td><input type="submit" name="submit" value="update" ></td>
</tr>
</form>
<?php
}
?>