php 文本框里面显示数据库调出来的资料

php 文本框里面显示数据库调出来的资料,,,在里面我标注了,,那个地方为什么是!=才能显示正确的数据库资料啊?我理解的是对比正确输出数据库内容的。大师貌似不知道为什么就写错了

<html>
<head>
<title>修改资料</title>
</head>
<form action="register_deal.php" method="post" name="myform" >
<table width="530" height="418" border="1" cellpadding="3" cellspacing="2" bordercolor="#66CC00" bgcolor="#FFFFFF">
      <tr>
        <td width="516" height="412" valign="top" background="images/bg.jpg"><table width="516" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="161" height="74">&nbsp;</td>
            <td width="345">&nbsp;</td>
            <td width="10">&nbsp;</td>
          </tr>
        <?php
        include"conn.php";
      $search2="111";//按员工编号查找 ,,具有唯一性
      $sql="SELECT * FROM data where Y_Emp_ID='".$search2."'";
      $result=mysql_query($sql);
      $num=mysql_num_rows($result); //数据库有几条数据
      if($num!=0)
    {
         while($row=mysql_fetch_array($result) )
         {         
            $Y_Emp_ID=$row[Y_Emp_ID ];
            $Y_Card_ID=$row[Y_Card_ID];
            $Y_Emp_Name=$row[Y_Emp_Name];
            $Y_Emp_Gender=$row[Y_Emp_Gender];
            $Y_Emp_PeoID=$row[Y_Emp_PeoID];
            $Y_Emp_Home=$row[Y_Emp_Home];
            $Y_Emp_Phone=$row[Y_Emp_Phone];
            $Y_Emp_Email=$row[Y_Emp_Email];
            $Y_Emp_Job=$row[Y_Emp_Job];
            $Y_Emp_DepA=$row[Y_Emp_DepA];
            
       }
       echo $Y_Emp_ID.$Y_Card_ID.$Y_Emp_Name;
    }
      else 
      {
          echo"打开表失败";
      }
  ?>

          <tr>
            <td width="32%" height="23" align="center">员工编号:</td>
            <td width="68%"><input name="Y_Emp_ID" type="text" id="Y_Emp_ID" size="20"value="<?php echo $Y_Emp_ID ?>">*</td>
          </tr>
          <tr>
            <td width="32%" height="23" align="center">员工卡号:</td>
            <td width="68%"><input name="Y_Card_ID" type="text" id="Y_Card_ID" size="20"value="<?php echo $Y_Card_ID ?>">*</td>
          </tr>
          <tr>
            <td height="22" align="center">姓&nbsp;&nbsp;&nbsp;&nbsp;名:</td>
            <td height="22"><input name="Y_Emp_Name" type="text" id="Y_Emp_Name" size="20"value="<?php echo "$Y_Emp_Name"?>">*</td>
          </tr>
          <tr>
            <td height="18" align="center">性&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
            <td height="18"><input name="Y_Emp_Gender" type="text" id="Y_Emp_Gender" size="20"value="<?php echo $Y_Emp_Gender ?>">* </td>
          </tr>
          <tr>
            <td height="19" align="center">身份证号:</td>
            <td height="19"><input name="Y_Emp_PeoID" type="text" id="Y_Emp_PeoID" size="20"value="<?php echo $Y_Emp_PeoID ?>">*</td>
          </tr>
          <tr>
            <td height="19" align="center">家庭住址:</td>
            <td height="19"><input name="Y_Emp_Home" type="text" id="Y_Emp_Home" size="30"value="<?php echo $Y_Emp_Home ?>"></td>
          </tr>
          <tr>
            <td height="19" align="center">私人电话:</td>
            <td height="19"><input name="Y_Emp_Phone" type="text" id="Y_Emp_Phone" size="30"value="<?php echo $Y_Emp_Phone ?>" ></td>
          </tr>
          <tr>
            <td height="19" align="center">邮&nbsp;&nbsp;&nbsp;&nbsp;箱:</td>
            <td height="19"><input name="Y_Emp_Email" type="text" id="Y_Emp_Email" size="30" value="<?php echo $Y_Emp_Email ?>">*</td>
          </tr>
          <tr>
            <td height="19" align="center">职&nbsp;&nbsp;&nbsp;&nbsp;位:</td>
             <td height="19"><input name="Y_Emp_Job" type="text" id="Y_Emp_Job" size="10" value="<?php echo $Y_Emp_Job ?>"></td>
          </tr>
          <tr>
             <td height="19" align="center">部&nbsp;&nbsp;&nbsp;&nbsp;门:</td>
             <td height="19"><input name="Y_Emp_DepA" type="text" id="Y_Emp_DepA" size="10" value="<?php echo $Y_Emp_DepA ?>"></td>
          </tr>

<td height="34">&nbsp;</td>
<td class="word_grey">&nbsp;&nbsp;
<input name="submit" type="submit" class="btn_grey" value="提交" onClick="return check()">&nbsp;
<input name="submit2" type="reset" class="btn_grey" value="重填"></td></tr>
              </table>
           </td>
            <td>&nbsp;</td>
          </tr>

    </table>
</form>
</body>
</html>

posted on 2013-11-04 21:29  为人民服务  阅读(833)  评论(0编辑  收藏  举报