本帖最后由 neuuuuuuu 于 2014-12-25 17:58:02 编辑

解决方案 »

  1.   

    sql语句为何不用引号引起来
    $sql= “update shopsystem set   name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id”;
      

  2.   

    引号加了  也报错 = - 
     Notice: Undefined variable: name in G:\wamp\www\net work\xiugai.php on line 12
    Notice: Undefined variable: tel in G:\wamp\www\net work\xiugai.php on line 12
    貌似执行了 但是数据库里是空白数据
      

  3.   

    $name ,$tel 变量在哪定义的?
      

  4.   

    1.
    $sql= update shopsystem set   name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id;
    改为
    $sql= "update shopsystem set   name=$name, tel=$tel ,mail=$mail ,QQ=$QQ, addr=$addr, sex=$sex, brandname=$brandname, commoditybrand=$commoditybrand, productID=$productID, ordername=$ordername, shopname=$shopname, shopaddr=$shopaddr, invoicenumber=$invoicenumber, purchasingdate=$purchasingdate where id=$id";2.$name, $tel这两个变量你没有赋值。
      

  5.   

    <?php
    $conn=mysql_connect('localhost','root','');
    mysql_select_db('root');
     mysql_query("set names 'GBK'");
    ?><?php
    $id = $_GET["id"];
    $sql="select * from shopsystem where id=$id";
    $query=mysql_query($sql);
    $rs=mysql_fetch_array($query);
    ?><form method="post" action="xiugai.php">
    <tr>
    <td>
    <P>:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="hidden" id="id" value="<?php echo $rs['id']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" id="name" value="<?php echo $rs['name']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" id="tel" value="<?php echo $rs['tel']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" id="email" value="<?php echo $rs['email']?>"/>&nbsp*</P>
    <P>:  &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" id="QQ" value="<?php echo $rs['QQ']?>"'/>&nbsp*</P>
    <P>:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" id="addr" value="<?php echo $rs['addr']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" id="sex" value="<?php echo $rs['sex']?>"/>&nbsp*</P><P>:&nbsp&nbsp<input type="text" id="brandname" value="<?php echo $rs['name']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp<input type="text" id="commoditybrand" value="<?php echo $rs['commoditybrand']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp<input type="text" id="productID" value="<?php echo $rs['productID']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp<input type="text" id="ordername" value="<?php echo $rs['ordername']?>"/>&nbsp*</P><P>:&nbsp&nbsp<input type="text" id="shopname" value="<?php echo $rs['shopname']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp<input type="text" id="shopaddr" value="<?php echo $rs['shopaddr']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp<input type="text" id="invoicenumber" value="<?php echo $rs['invoicenumber']?>"/>&nbsp*</P>
    <P>:&nbsp&nbsp<input type="text" id="purchasingdate" value="<?php echo $rs['purchasingdate']?>"/>&nbsp*</P>
    <P>:1990-01-01&nbsp&nbsp* </P>
    <td><input name='del' type='submit' id='del' value='修改' /></td>
    </tr>
    </from><?php $conn = mysql_connect("localhost", "root", "");if (!$conn)
      {
      die('Could not connect: ' . mysql_error());
      }
    mysql_select_db("root",$conn)or die(mysql_error());
    mysql_query('set names GB2312');
    $sql= "UPDATE shopsystem SET name=$name,tel=$tel,email=$email,QQ=$QQ,addr=$addr,sex=$sex,brandname=$brandname,commoditybrand=$commoditybrand,productID=$productID,ordername=$ordername,shopname=$shopname,shopaddr=$shopaddr,invoicenumber=$invoicenumber,purchasingdate=$purchasingdate WHERE  id=$id";if (!mysql_query($sql,$conn))
      {
      die ('Error: ' . mysql_error());
      }mysql_close($conn);
    ?>
    完整的代码 = -  求助
      

  6.   

      因为论坛屏蔽  = - input前面的字段我就删了  
      那个表单里所有变量都在报错