$result=mysql_query("$query",$con) or die(mysql_error());看看出错提示。  :)

解决方案 »

  1.   

    请问hahawen(变态的大龄青年) ,你说的是什么意思?
    因为我是根据where条件来只更新部分数据的。
      

  2.   

    where 后面的变量加上单引号试试吧。
      

  3.   

    这是从数据库中获得数据的页面,在文本框中输入修改的值,然后点修改按钮调用
    forderupdate2.php,来完成更新功能,可是运行没有错误,就是更新不了值,请哪位指点一下了。解决问题立即给分
    <html><head>
      <title>修改订单</title>
    </head><body>
       <script src="..\menu.js" language="javascript"></script>
    <?php
      include "sescheck.php";
      include "conn.php";
      $query="select * from  forecast where fcno = $flag";
      $result=mysql_query("$query",$con);
      $r=mysql_fetch_array($result);
      //赋值
      $fcno=$r["fcno"] ;
      $fcpartno=$r["fcpartno"];
      $fcdate=$r["fcdate"];
      $fcpartno2=$r["fcpartno2"];
      $fcmoldno=$r["fcmoldno"];
      $fcexplan=$r["fcexplan"];
      $fcnumber=$r["fcnumber"];
      $fcdate2=$r["fcdate2"];
      $fcexplan2=$r["fcexplan2"];
      //$fcaddid=$r["fcaddid"];
      //$fcadddt=$r["fcadddt"];
      //$fcmodid=$r["fcmodid"];
      //$fcmoddt=$r["fcmoddt"]; ?>
    <P align="center"><font  size="5" color="00000c">
    </font></P>
    <p></p>
    <div align="center">
    <center>
    <p><b>修改订单内容</b></p>
    <table align="center" width="80%" border="1" cellspacing="0" cellpadding="4" bordercolorlight="#CC9966" bgcolor="#00F2EE" bordercolordark="#FFFFFF" class="LZH"><tr bgcolor="#F7F2ff" style="font-size:14.8px;font-weight:bold">
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">订单编号:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcnotxt"  value=<?php echo $flag ?> >
    </td>
    </tr>
    </center>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">料号1:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcpartnotxt"  value=<?php echo $fcpartno ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">日期:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcdatetxt"   value=<?php echo $fcdate ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">料号2:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcpartno2txt" value=<?php echo $fcpartno2 ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">模号:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcmoldnotxt" value=<?php echo $fcmoldno ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">料号2说明:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcexpalntxt" value=<?php echo $fcexplan ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">数量:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcnumbertxt" value=<?php echo $fcnumber ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">需求日期:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcdate2txt" value=<?php echo $fcdate2 ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">料号1说明:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcexplan2txt" value=<?php echo $fcexplan2 ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">新增者:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcaddidtxt"  value="" >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">新增时间:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcadddttxt" value="" >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">修改者:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcmodtxt"   value=<?php echo $user ?> >
    </td>
    </tr>
    <tr>
    <td width="183" align="right" height="23">
    <p align="right">修改时间:
    </td>
    <center>
    <td width="476" height="23">
    <input type="text" name="fcmoddttxt"   value=<?php print(date( "Y-m-j" )) ?> >
    </td>
    </tr> </tr>
    </table>
     <center>
    <table width="778" border="0" cellspacing="0" cellpadding="0">
      <tr>
          <td width="371" align="right">
            <form name="form1" method="post" action="forderupdate2.php">
       <input type="submit" name="Submit" value="修改">
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </form></td>
                    <td width="407"><form name="form2" method="post" action="fordermodify.php">
              <input type="submit" name="Submit" value="返回">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </form></td>
      </tr>
    </table>  </center>
    <p>&nbsp;</p>
    </body></html>forderupdat2.php的代码如下:
    <html>
     <title>更新订单</title>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="font1.css" rel="stylesheet" type="text/css">
    </head>
    <body bgcolor="f4f4f4" leftmargin="0" topmargin="0">
    <?php
    include "sescheck.php";//检查用户合法性
    include "conn.php";//数据库连接
    $query="update forecast set  fcdate='$fcdatetxt',fcpartno2='$fcpartno2txt',fcmoldno='$fcmoldnotxt',fcexplan='$fcexplantxt',fcnumber='$fcnumbertxt',fcdate2='$fcdate2txt',
    fcexplan2='$fcexplan2txt',fcaddid='$fcaddidtxt',fcadddt='$fcadddttxt',fcmodid='$fcmodtxt',fcmoddt='$fomoddttxt' where fcno = '$fcnotxt' and fcpartno='$fcpartnotxt' ";
    $result=mysql_query("$query",$con)or die(mysql_error());
    require("showForecast.php");//调用显示
    ?>
    </p>
    </body></html>
      

  4.   

    '$fcexplan2txt'单引号改为双引号