<?php
}
?>
<?php
if(isset($success)) {
if($success) {
echo '<p>User Created Successfully!';
}elseif($sucess==false) {
echo '<p>User Name existed.';
}
}
?>
再接下来,我们编写一个用户列表页面。
<table>
<tr><th>User Name</th><th>CreateTime</th><th>Action</th>
</tr>
<?php
include 'conn.php';
$query="select * from User;";
$res=$mysql->query($query);
while($row=$res->fetch_array()) {
?>
<tr>
<td><?= $row['UserName'] ?></td>
<td><?= date('Y-m-d',strtotime($row['CreateTime']))?> </td>
<td><a href="UserEdit.php?action=update&ID=<?= $row['UserName'] ?>">Edit</a>
<a href="action=delete&ID=<?= $row['UserName'] ?>">Delete</a>
</td>
</tr>
<?php
}
$res->close();
$mysql->close();
?>
</table>







