<?php
$xh=$_GET['xh'];
$db=new mysqli("localhost","root","","test");
$q= "select * from stu where xh=$xh";
$r=$db->query($q);
$row=$r->fetch_assoc();
?>
<form action="save.php">
<p>学号:<input type=text name=xh value=<?php echo $row['xh'];?> size=20 readonly> </p>
<p>姓名:<input type=text name=xm value=<?php echo $row['xm'];?> size=20> </p>
<p>性别:<input type=radio value=0 <?php if($row['xb']==0) echo "checked";?> name=xb >male<input type=radio value=1 <?php if($row['xb']==1) echo "checked";?> name=xb >female</p>
<p><input type=submit value="提交" name=tj>
<input type=reset value="重置" name=cz></p>
</form>
<?
$r->free();
$db->close();
?>
$xh=$_GET['xh'];
$db=new mysqli("localhost","root","","test");
$q= "select * from stu where xh=".intval($xh);
$r=$db->query($q);
$row=$r->fetch_assoc();
}追问
谢谢你,这个问题是解决了,但是下面的表单出现问题了,你可以再帮我看看吗,就是value=这里出现问题了