<html>  
<head>  
    <meta charset="utf-8" />
    <title>修改用户数据</title>  
</head>  
<body>  
<?php  
     header('Content-type: text/html; charset=UTF8'); 
        //连接mysql数据库  
        $conn  = mysql_connect('localhost','root','root');
mysql_select_db('member',$conn); 
   
        //查找id  
$id = $_GET["id"];
$sql = "select from worker where id=".$id;

        //获取结果数组  
$result = mysql_query($sql);
                $row = mysql_fetch_array($result);
?>  
<form method = "POST" action="user_edit.php">
用户名:<br>
<input type="text" name="uname" value="<?php echo $row['id']?>"/><br/>
密码:<br>
<input type="password" name="pwd" value="<?php echo $row['passwd']?>"/><br/>
年龄:<br>
<input type="text" name="old" value="<?php echo $row['age']?>"/><br/>
民族:<br>
<input type="text" name="rc" value="<?php echo $row['race']?>"/><br/>
性别:
<input type="radio" name="sex" value="男" <?php if ($row['sex']=='男') echo "checked" ;?>/>
<input type="radio" name="sex" value="女" <?php if ($row['sex']=='女') echo "checked" ;?>/>
<br>
<input type = "submit" value = "提交更改"/>
<input type="hidden" name="id" value="<?php echo $row['id']?>"/>

</body>
</html>

解决方案 »

  1.   

    从错误信息来看是说 $row 变量没有定义
      

  2.   

    后缀是php
      

  3.   

    报错信息跟你贴的代码不符。是不是还有代码没贴上来?
    提示33行$row没定义,但是33行没有$row
      

  4.   

    你uname放id是什么鬼
      

  5.   

    $result = mysql_query($sql);
    改为$result = mysql_query($sql) or die(mysql_error());
    看看有什么错误。