<?php
require_once'test3.php';
?>
<html>
<head>
<title>修改界面</title>
</head>
<body>
<?php
if(!empty($_GET['id'])){
connectDb();
$id=intval($_GET['id']);//创建一个ID的值
$result=mysql_query("SELECT * FROM Persons WHERE personID=$id");
if(mysql_errno()){
die ('错误');
}
$arr=mysql_fetch_assoc($result);//把查询的一条数据转化成数组
//print_r ($arr);
}else{
die('获取失败');
}
?>
<font color='red' size='4'>
<form action="test5.php" method="post">
用户ID: <input type="text" name="personID" value="<?php echo $arr['personID']; ?>" readonly/>
用户名字: <input type="text" name="firstname" value="<?php echo $arr['FirstName']; ?>"/>
用户昵称: <input type="text" name="lastname" value="<?php echo $arr['LastName']; ?>"/>
用户年龄: <input type="text" name="age" value="<?php echo $arr['Age']; ?>"/>
<input type="submit" value ="修改数据"/>
</form>
</body>
</html>